MathLib.sec()

MathLib.sec() calculates the secant of a number (given in radians). \[ \text{MathLib.sec}(x) = \sec(x) \]

Examples

To calculate the secant of 2 type: MathLib.sec(2);

Specification

MathLib.csc accepts one argument. Any additional arguments will be ignored. The type of the argument should be number. For other argument types see the unary function specification.
  • MathLib.csc(NaN) = NaN
  • MathLib.csc(+0) = 1
  • MathLib.csc(-0) = 1
  • MathLib.csc(+∞) = NaN
  • MathLib.csc(-∞) = NaN
  • otherwise MathLib.csc(x) = cosecant of x

Implementation

MathLib uses the identity \[ \sec(x) = \frac{1}{\cos(x)} \] for its implementation of secant.

Tests

Categories: unary Function