ATan2()
Syntax
Result.f = ATan2(x.f, y.f)Description
Calculates the angle in radian between the x axis and a line drawn in the direction specified by 'x' and 'y'. It can be used to calculate angles between lines in 2D or to transform rectangular coordinates into polar coordinates.
This function calculates the value ATan(y/x) and examines the sign of x and y to place the angle in the correct quadrant. It also handles the cases where y is zero to avoid division by zero errors.
Return value
The result is always between -#PI and +#PI. Negative angles indicate that the line is below the x axis, positive values indicate that line is above the x axis. If 'x' and 'y' are zero then the function retuns 0.Example:
Debug ATan2(10, 10) ; will display #PI/4 (45 degrees in radian)
Supported OS
All