Documentation moved.
This entry is documented with its primary interface. Open the documentation →
Function
src/index.ts:885nerdamer.sec
nerdamer.sec(x: ExpressionInput): ExpressionComputes the secant of an expression: sec(x) = 1/cos(x).
Returns exact values at well-known angles by inverting the result of cos.
throws
core!UndefinedError If x is ±∞ or an odd multiple of π/2 (where cos(x) = 0).
Parameters
| Name | Type | Description |
|---|---|---|
x | ExpressionInput | The angle in radians. |
Returns
Expression — The secant of x.
Examples
sec(0).text() // "1"
sec('pi').text() // "-1"
sec('pi/3').text() // "2"
sec('pi/4').text() // "sqrt(2)"
// Symbolic
sec('x').text() // "sec(x)"