24.105. Math.atan2( ): compute the angle from the X axis to a pointECMAScript v124.105.1. SynopsisMath.atan2(y, x) 24.105.1.1. Arguments
24.105.1.2. ReturnsA value between -π and π radians that specifies the counterclockwise angle between the positive X axis and the point (x, y). 24.105.2. DescriptionThe Math.atan2( ) function computes the arc tangent of the ratio y/x. The y argument can be considered the Y coordinate (or "rise") of a point, and the x argument can be considered the X coordinate (or "run") of the point. Note the unusual order of the arguments to this function: the Y coordinate is passed before the X coordinate. |