This site is supported by donations to The OEIS Foundation.

# Template:Asin

The {{asin}} circular function template returns the arc sine (a circular angle in $[{\frac {-\pi }{2}},\,{\frac {+\pi }{2}}]\,$ radians) of $x\,$ , where $x\,$ is a real number in closed interval [-1, +1].

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

## Usage

{{asin|a real number in closed interval [-1, +1]}}

## Valid input

A real number in closed interval [-1, +1].

## Examples

Examples with valid input

Code Result
{{asin|- (2^(1/2) / 2)}} -0.78539816339745
{{asin|-0.5}} -0.5235987755983
{{asin|0}} 0
{{asin|0.5}} 0.5235987755983
{{asin|2^(1/2) / 2}} 0.78539816339745

Examples with invalid input (returns an error message)

Code Result
{{asin|i}} Expression error: Unrecognized word "i".
{{asin|- (2^(1/2))}} Invalid argument for asin: < -1 or > 1.
{{asin|+ 2^(1/2)}} Invalid argument for asin: < -1 or > 1.

## Code

Currently (using built-in error message)


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



instead of (using custom error message)


{{ifnum| {{{1|NAN}}}
| {{#ifexpr: abs ({{{1}}}) <= 1
| {{#expr: asin ({{{1}}}) }}
| {{error| Asin error: Argument must be a real number in closed interval [-1, +1] }}
}}
| {{error| Asin error: Argument must be a real number in closed interval [-1, +1] }}
}}