next up previous contents
Next: ATAN2 Inverse Trigonometric 4-Quadrant Up: Mathematical Functions Previous: ASIN Inverse Trigonometric Arcsine   Contents

Subsections

ATAN Inverse Trigonometric Arctangent Function

Usage

Computes the atan function for its argument. The general syntax for its use is

  y = atan(x)

where x is an n-dimensional array of numerical type. Integer types are promoted to the double type prior to calculation of the atan function. Output y is of the same size and type as the input x, (unless x is an integer, in which case y is a double type).

Function Internals

Mathematically, the atan function is defined for all arguments x as

$\displaystyle \mathrm{atan} x \equiv \frac{i}{2}\left(\log(1-i x) - \log(i x + 1)\right).
$

For real valued variables x, the function is computed directly using the standard C library's numerical atan function. For both real and complex arguments x, note that generally

$\displaystyle \mathrm{atan}(\tan(x)) \neq x,
$

due to the periodicity of tan(x).

Example

The following code demonstates the atan function over the range [-1,1].

--> t = linspace(-1,1);
--> plot(t,atan(t))

3216


next up previous contents
Next: ATAN2 Inverse Trigonometric 4-Quadrant Up: Mathematical Functions Previous: ASIN Inverse Trigonometric Arcsine   Contents
Samit K. Basu 2005-03-16