atan

Inverse tangent of each element, with the result in radians.

Category: Mathematics > Elementary Math

Syntax

Y = atan(X)

Returns the inverse tangent of each element of X.

Description

atan(X) is the angle whose tangent is X. It is defined for every real input and approaches pi/2 as X goes to Inf. Because it cannot tell the quadrant of a point, atan(y/x) loses information; use atan2(y, x) when both coordinates are known.

Input arguments

X
Numeric array of any size. Complex values are allowed.

Output arguments

Y
Array of the same size as X, in radians. For real input the values lie in (-pi/2, pi/2).

Example

Inverse tangent

atan([0 1 -1 Inf])
Output
ans = 1×4

         0    0.7854   -0.7854    1.5708

See also

tan atan2 atand atanh