MathLib.atan2 function

MathLib.atan2 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.

Package

eglx.lang

Syntax
static function atan2(y float in, x float in) returns(float);
y, x
Numerator and denominator for computation.

The returned value is between -pi and pi.

Example use

After the following code runs, the value of result is 0.19739555984988078.

x INT = 5;
y INT = 1;

result FLOAT = mathLib.atan2(y, x);
Comments

In the case of Java™, EGL uses methods in the Java StrictMath class that are equivalent to the EGL functions. This usage ensures that the runtime behavior is the same for every Java Virtual Machine.

Compatibility

Table 1. Compatibility
Target Issue
Java No issues.
JavaScript No issues.