MathLib.arcsec()

MathLib.arcsec() calculates the inverse secant of a number. \[ \text{MathLib.arcsec}(x) = \operatorname{arcsec}(x) \]

Examples

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

Specification

MathLib.arcsec 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.
  1. MathLib.arcsec(NaN) = NaN
  2. MathLib.arcsec(x) = NaN (if -1 < x < 1)
  3. MathLib.arcsec(+∞) = π2
  4. MathLib.arcsec(-∞) = π2
  5. MathLib.arcsec(1) = +0
  6. otherwise MathLib.arcsec(x) = inverse secant of x.

Implementation

MathLib uses the identity \[ \operatorname{arcsec}(x) = \arccos\left(\frac{1}{x}\right) \] and the built-in JavaScript function Math.acos.

Tests

Categories: unary Function