@ATan2 (Formula Language)
Calculates the arc tangent using the tangent y/x of an angle.
Syntax
@ATan2( x ; y )
Parameters
x
Number or number list. The denominator of the tangent value y / x.
y
Number or number list. The numerator of the tangent value y / x.
Usage
If either parameter is a list, the function operates pair-wise on the list elements, and the return value is a list with the number of elements in the larger list.
Return value
angle
Number. An angle, in radians, from -pi through pi. This represents an angle between -180 and 180 degrees, depending on the sign of x and y (see the list below).
| If |
Then angle is in the range |
|---|---|
| xis positive yis positive |
0 to pi/2 (Quadrant I) |
| x is negative y is positive |
pi/2 to pi (Quadrant II) |
| x is negative y is negative |
-pi to -pi/2 (Quadrant III) |
| x is positive y is negative |
-pi/2 to 0 (Quadrant IV) |
Examples
- This example returns pi/4.
@ATan2( 1; 1 ) - This example returns 3pi/4.
@ATan2( -1; 1 ) - This example returns 1.10715 radians (63.4 degrees).
@ATan2 ( 1; 2 ) - This example returns pi/4, 3pi/4, and 1.10715 radians in a list.
@ATan2 ( 1 : : (-1) : 1; 1 : 1 : 2 )