Documentation

atan

Inverse tangent in radians

Syntax

Description

example

Y = atan(X)returns theInverse Tangent(tan-1) of the elements ofXin radians. The function accepts both real and complex inputs.

  • For real values ofX,atan(X)returns values in the interval [-π/2, π/2].

  • For complex values ofX,atan(X)returns complex values.

Examples

collapse all

Find the inverse tangent of a value.

atan(0.8)
ans = 0.6747

Find the inverse tangent of the elements of vectorx. Theatanfunction acts onxelement-wise.

x = [0.5i 1+3i -2.2+i]; Y = atan(x)
Y =1×3 complex0.0000 + 0.5493i 1.4615 + 0.3059i -1.2019 + 0.1506i

Plot the inverse tangent function over the interval - 2 0 x 2 0 .

x = -20:0.01:20; plot(x,atan(x)) gridon

Input Arguments

collapse all

Tangent of angle, specified as a scalar, vector, matrix, or multidimensional array. Theatanoperation is element-wise whenX是nonscalar.

Data Types:single|double
Complex Number Support:Yes

More About

collapse all

Inverse Tangent

The inverse tangent is defined as

tan 1 ( z ) = i 2 log ( i + z i z ) .

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

GPU Code Generation
Generate CUDA® code for NVIDIA® GPUs using GPU Coder™.

See Also

|||

Introduced before R2006a