darctan2

This function returns the inverse tangent of an angle y/x, where y = Opposite side of triangle and x = Adjacent side of triangle. Unlike darctan() the function darctan2() is valid for all angles and so may be used to convert a vector to an angle without risking division by zero, and it also returns a result in the correct quadrant.

NOTE: The value returned is in degrees, not radians.

 

Syntax:

darctan2(y, x);

ArgumentTypeDescription
yRealThe y coordinate to calculate.
xRealThe x coordinate to calculate.

 

Returns:

Real

 

Example:

val = darctan2(1, 1);

This will set "val" to the correct angle.