Antares
Spell Reviewer
- Joined
- Dec 13, 2009
- Messages
- 982
Hello,
I have just recently learned JASS and wanted to make a function that calculates an angle with an arcustangent function. this is the function:
later in the script, the variable declaration and function call:
The values for G and A (Adjacent and Opposite) are not being handled by the arcustangent function. i just substituted the equation with set G = 5 and set A = 1, to see if this is the problem, but it didnt change anything. So the equation is NOT the problem. the function always returns zero (as the arcustangent of zero is zero).
Im completly new to JASS, so i dont know if I made any syntax errors. Jasscraft and the World Editor did not spit out any errors.
I have just recently learned JASS and wanted to make a function that calculates an angle with an arcustangent function. this is the function:
JASS:
function arcustangent takes real G, real A returns real
if ( A < 0 ) then
return AtanBJ( G / A ) + 180
elseif ( A == 0 ) then
if ( G > 0 ) then
return AtanBJ( G / ( A + 0.01 ) )
else
return AtanBJ( G / ( A - 0.01 ) )
endif
else
return AtanBJ( G / A )
endif
endfunction
later in the script, the variable declaration and function call:
JASS:
function fastcalculation takes nothing returns nothing
...
...
local real A
local real G
...
...
set G = ScalarSpeedFrontVtF - ScalarSpeedVertBack
set A = ScalarSpeedFrontPtF - ScalarSpeedParaBack
set udg_ScalarMA[i] = arcustangent( G, A )
The values for G and A (Adjacent and Opposite) are not being handled by the arcustangent function. i just substituted the equation with set G = 5 and set A = 1, to see if this is the problem, but it didnt change anything. So the equation is NOT the problem. the function always returns zero (as the arcustangent of zero is zero).
Im completly new to JASS, so i dont know if I made any syntax errors. Jasscraft and the World Editor did not spit out any errors.