Documentation moved.
This entry is now part of the unified function reference. Open the unified page →
Function
src/index.ts:742nerdamer.tan
nerdamer.tan(x: ExpressionInput): ExpressionComputes the tangent of an expression. Tangent is an odd function:
`tan(-x)`automatically simplifies to
`-tan(x)`. Returns
`0`for all integer multiples of π. Inverse trig compositions are resolved: -
`tan(atan(x))`returns
`x`-
`tan(asin(x))`returns
`x/sqrt(1 − x²)`-
`tan(acos(x))`returns
`sqrt(1 − x²)/x`throws
UndefinedError If
`x`is
`±∞`or an odd multiple of
`π/2`.
Parameters
| Name | Type | Description |
|---|---|---|
x | ExpressionInput | The angle in radians. |
Returns
Expression — The tangent of `x`.
Examples
tan(0).text() // "0"
tan('pi').text() // "0"
tan('pi/4').text() // "1"
// Symbolic
tan('x').text() // "tan(x)"