JavaScript Math.atan2()
JavaScript Math.atan2()
The Math.atan2() method is used to return the arctangent of the quotient of its arguments. Its value is between PI and -PI radians. The number returned is used to represent the counterclockwise angle in radians between the positive X-axis and the point (x, y).
Syntax:-
Its syntax is:- Math.atan2(y, x)
Return:-
Its return is:- number between PI and -PI
Further Explanation:-
Parameter | Description |
---|---|
y | Required. A number representing the y-coordinate |
x | Required. A number representing the x-coordinate |