atan - Inverse tangent in radians - MATLAB (original) (raw)

Main Content

Inverse tangent in radians

Syntax

Description

Y = atan([X](#mw%5F03e05ff0-7d37-40a9-a88c-0febda453870)) returns the Inverse Tangent (tan-1) of the elements of X in radians. The function accepts both real and complex inputs.

example

Examples

collapse all

Find the inverse tangent of a value.

Find the inverse tangent of the elements of vector x. The atan function acts on x element-wise.

x = [0.5i 1+3i -2.2+i]; Y = atan(x)

Y = 1×3 complex

0.0000 + 0.5493i 1.4615 + 0.3059i -1.2019 + 0.1506i

Plot the inverse tangent function over the interval -20≤x≤20.

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

Figure contains an axes object. The axes object contains an object of type line.

Input Arguments

collapse all

Tangent of angle, specified as a scalar, vector, matrix, multidimensional array, table, or timetable. The atan operation is element-wise whenX is nonscalar.

Data Types: single | double | table | timetable
Complex Number Support: Yes

More About

collapse all

The inverse tangent is defined as

This definition of the atan function returns angles in radians within the interval [-π/2, π/2]. To find the four-quadrant inverse tangent, where the returned angles are in the interval [-π, π], use atan2.

Extended Capabilities

expand all

Theatan function fully supports tall arrays. For more information, see Tall Arrays.

The atan function fully supports GPU arrays. To run the function on a GPU, specify the input data as a gpuArray (Parallel Computing Toolbox). For more information, see Run MATLAB Functions on a GPU (Parallel Computing Toolbox).

Version History

Introduced before R2006a

expand all

The atan function can calculate on all variables within a table or timetable without indexing to access those variables. All variables must have data types that support the calculation. For more information, see Direct Calculations on Tables and Timetables.