Choose where you’d like to start

atan2()

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>);
ParameterData typeDescription
<variable>NUMBERVariable which will contain the returned value.
<y-axis>NUMBERThe y-axis value of the point whose atan2 value needs to be returned.
<x-axis>NUMBERThe x-axis value of the point whose atan2 value needs to be returned.

Examples

number = 1;
atan2Value = number.atan2(2);       // returns 0.4636476090008061

Get Started Now

Execute