atan2()

The mathLib.atan2() system function computes the principal value of the arc tangent of y/x, using the signs of both arguments to determine the quadrant of the return value.

Syntax

  mathLib.atan2(
    y FLOAT in,
    x FLOAT in)
  returns (result FLOAT)
y, x
Input can be any variable or expressions that are assignment compatible with the FLOAT type (see "Assignment compatibility in EGL").
result
The principal value of the arc tangent of y/x is returned as a FLOAT value, in radians, in the range -pi to pi.

Example

  x INT = 5;
  y INT = 1;

  result FLOAT = mathLib.atan2(y, x);
  // result is 0.19739555984988078

Feedback