This site is supported by donations to The OEIS Foundation.

# Template:Tan

The {{tan}} circular function template returns the tangent of ${\displaystyle \scriptstyle x\,}$, where ${\displaystyle \scriptstyle x\,}$ is a real number expressing a circular angle in radians.

Note that you may also use the tan operator (used within the {{#expr: }} parser function extension, e.g. {{#expr: tan (pi/6) }}) which also takes a circular angle in radians as argument.

## Usage

{{tan|a real number}}

## Valid input

A real number (expressing a circular angle in radians) as argument.

## Examples

Examples with valid input

Code Result
{{tan|-5*pi/2}} -3.2662478706391E+15
{{tan|-pi/2}} -1.6331239353195E+16
{{tan|-pi/3}} -1.7320508075689
{{tan|-pi/4}} -1
{{tan|-pi/6}} -0.57735026918963
{{tan|0}} 0
{{tan|pi/6}} 0.57735026918963
{{tan|pi/4}} 1
{{tan|pi/3}} 1.7320508075689
{{tan|pi/2}} 1.6331239353195E+16
{{tan|5*pi/2}} 3.2662478706391E+15

Examples with invalid input (returns an error message)

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

## Code

Currently (using built-in error message)

```
{{#expr: tan ({{{1}}}) }}

```

instead of (using custom error message)

```
{{ifnum| {{{1|NAN}}}
| {{#expr: tan ({{{1}}}) }}
| {{error| Tan error: Argument must be a real number (circular angle in radians) }}
}}

```