Contents Previous Next Subchapters

Inverse Tangent Function With Two Arguments
Syntax atan2(yx)
See Also tan , atan , angle

Description
Returns the element-by-element inverse tangent of y / x where y and x are real or double-precision matrices. If the types of x and y do not agree, coercion is done and then the result is computed. The elements of the result are between -pi and +pi.

Example
     atan2(1., 1.)
returns
     0.785398
Even though x is in the denominator in the definition above, zero is a valid value for an element of x.
     atan2([0, 1., 0, -1.], [-1., 0, 1., 0])
returns
     [ 3.14159 , 1.5708 , 0 , -1.5708 ]