This site is supported by donations to The OEIS Foundation.

# Template:Atan/doc

This documentation subpage contains instructions, categories, or other information for Template:Atan. [<Edit> Template:Atan]

[⧼Purge⧽ Template:Atan/doc]

The {{atan}} circular function template returns the arc tangent (a circular angle in ${\displaystyle \scriptstyle ({\frac {-\pi }{2}},\,{\frac {+\pi }{2}})\,}$ radians) of ${\displaystyle \scriptstyle x\,}$, where ${\displaystyle \scriptstyle x\,}$ is a real number.

Note that you may also use the atan operator (used within the {{#expr: }} parser function extension, e.g. {{#expr: atan 1 }}) which also returns a circular angle in ${\displaystyle \scriptstyle ({\frac {-\pi }{2}},\,{\frac {+\pi }{2}})\,}$ radians.

## Usage

{{atan|a real number}}

A real number.

## Examples

Examples with valid input

Code Result
{{atan|- (3^(1/2))}} -1.0471975511966
{{atan|-1}} -0.78539816339745
{{atan|- 1 / 3^(1/2)}} -0.5235987755983
{{atan|0}} 0
{{atan|1 / 3^(1/2)}} 0.5235987755983
{{atan|1}} 0.78539816339745
{{atan|3^(1/2)}} 1.0471975511966

Examples with invalid input (returns an error message)

Code Result
{{atan|i}} Expression error: Unrecognized word "i".

## Code

Currently (using built-in error message)


{{#expr: atan ({{{1}}}) }}



instead of (using custom error message)


{{ifnum| {{{1|NAN}}}
| {{#expr: atan ({{{1}}}) }}
| {{error| Atan error: Argument must be a real number }}
}}