Documentation moved.
This entry is documented with its primary interface. Open the documentation →
Function
src/index.ts:849nerdamer.sin
nerdamer.sin(x: ExpressionInput): ExpressionComputes the sine of an expression. Returns exact symbolic values for
well-known multiples of π (π/6, π/4, π/3, π/2, π, etc.).
Sine is an odd function: sin(-x) automatically simplifies to -sin(x).
Inverse trig compositions are resolved:
- sin(asin(x)) returns x
- sin(acos(x)) returns sqrt(1 − x²)
- sin(atan(x)) returns x/sqrt(1 + x²)
throws
core!UndefinedError If x is ±∞.
Parameters
| Name | Type | Description |
|---|---|---|
x | ExpressionInput | The angle in radians. |
Returns
Expression — The sine of x.
Examples
sin(0).text() // "0"
sin('pi').text() // "0"
sin('pi/2').text() // "1"
sin('pi/6').text() // "1/2"
sin('pi/4').text() // "1/2*sqrt(2)"
sin('pi/3').text() // "1/2*sqrt(3)"
// Symbolic
sin('x').text() // "sin(x)"