Hello Mike,
the version 9,30 does not implement the function atan2(). We added this math function in version 10.0. Well, how to calculate such value in 9.30?
I suppose, you want to calculate the angle from a vector connecting the origin position 0,0 and some x,y position. In such case you can achieve the same by using e.g. the math_acos() function. The following is a code snippet I have extracted from the Rotate Touch Handler. This handler calculates from the performed 'rotation gesture' the corresponding angle:
var float x = ...
var float y = ...
// The distance between the x,y position and the center of the coordinate system
var float radius = math_sqrt( float(( x * x ) + ( y * y )));
var float angle = 0.0;
if ( radius > 0.0 )
angle = math_acos( x / radius );
else
... vector has length = 0 -> the angle is unknown
if ( y > 0 )
angle = 360 - angle;
Is this something you are looking for?
Best regards
Paul Banach