Parameters or Arguments
y The y-coordinate of a point. x The x-coordinate of a point.
The atan2() characteristic returns the arc tangent of (x,y) coordinates and the end result is expressed in radians.
Math is a placeholder object that incorporates mathematical functions and constants of which atan2() is one of these functions.
In this example, we have invoked the atan2() characteristic the usage of the Math class.
We have written the output of the atan2() function to the web browser console log, for demonstration purposes, to exhibit what the atan2() characteristic returns.
The following will be output to the internet browser console log:
In this example, the first output to the console log again 1.446441332248135 which is the arc tangent of the (x,y) coordinate the place 8 is the y-coordinate and 1 is the x-coordinate.
The 2d output to the console log back 3.141592653589793 which is the arc tangent of the (x,y) coordinate the place 0 is the y-coordinate and -9 is the x-coordinate.
The end result from the atan2() feature is expressed in radians.