atan2()
Table of Contents
Overview
The atan2() function returns the angle (in radians) between the positive x-axis and the ray from (0,0) to the specified point (x,y).
Return Type
Syntax
<variable> = atan2(<y-axis>, <x-axis>);
(or)<variable> = <y-axis>.atan2(<x-axis>);
Parameter | Data type | Description |
---|---|---|
<variable> | NUMBER | Variable which will contain the returned value. |
<y-axis> | NUMBER | The y-axis value of the point whose atan2 value needs to be returned. |
<x-axis> | NUMBER | The x-axis value of the point whose atan2 value needs to be returned. |
Examples
number = 1;
atan2Value = number.atan2(2); // returns 0.4636476090008061