Documentation moved.
This entry is documented with its primary interface. Open the documentation →
Function
src/index.ts:850nerdamer.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
core!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)"