nerdamer.sec(x: ExpressionInput): Expression
Computes the secant of an expression:
`sec(x) = 1/cos(x)`
.
Returns exact values at well-known angles by inverting the result of cos.
throwsUndefinedError If
`x`
is
`±∞`
or an odd multiple of
`π/2`
(where
`cos(x) = 0`
).
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)"