This site is supported by donations to The OEIS Foundation.


From OeisWiki
Jump to: navigation, search

The {{sin}} circular function template returns the sine of , where is a real number expressing a circular angle in radians.

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


{{sin|a real number}}

Valid input

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


Examples with valid input

Code Result
{{sin|-5*pi/2}} -1
{{sin|-pi/2}} -1
{{sin|-pi/3}} -0.86602540378444
{{sin|-pi/4}} -0.70710678118655
{{sin|-pi/6}} -0.5
{{sin|0}} 0
{{sin|pi/6}} 0.5
{{sin|pi/4}} 0.70710678118655
{{sin|pi/3}} 0.86602540378444
{{sin|pi/2}} 1
{{sin|5*pi/2}} 1

Examples with invalid input (returns an error message)

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


Currently (using built-in error message)

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

instead of (using custom error message)

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

See also