atan2
Trigonometric arctangent (quadrant dependent) function.
Syntax
atan2(expr1, expr_2)
Argument
- expr1, expr2
- A pair of valid scalar, vector, or matrix expressions.
Example
Templex Expression | Result |
---|---|
{atan2(PI, 0)} |
0, 1.5708 |
{atan2( {1, 1, -1, -1},
|
0.785398, 2.35619,
|
Comments
The resulting angles are measured in radians. The result is the arctangent value of expr_1 divided by expr_2.
The sign of the result is determined by the quadrant containing expr_1 and expr_2. If expr_1 and expr_2 are positive, the result is in Quadrant I. If both expressions are negative, the results are in Quadrant III. If expr_1 is positive and expr_2 is negative, the result is in Quadrant II. Otherwise the result is in Quadrant IV.
If either or both expressions are vectors, the result is a vector whose values are the arctangent of expr_1 divided by expr_2. expr_1 and expr_2 must have the same dimensions.
If expr_1 and expr_2 are matrices, the result is a scalar which is the arctangent of expr_1 divided by expr_2.