MathLib.arccos()

MathLib.arccos() calculates the inverse cosine of a number. \[ \text{MathLib.arccos}(x) = \arccos(x) \]

Examples

Evaluating

To calculate the inverse cosine of 2 type: MathLib.arccos(2);

Plotting

It is very easy to generate a plot of the arccos function: var plot = new MathLib.Screen2D('plot', { width: 300, height: 300, lookAt: {x: 0, y: 1.5}, range: {x: 1.75, y: 1.75} }); MathLib.arccos.draw(plot, { lineColor: 'blue' });

Specification

MathLib.arccos 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.arccos(NaN) = NaN
  2. MathLib.arccos(x) = NaN if x>1
  3. MathLib.arccos(x) = NaN if x<-1
  4. otherwise MathLib.arccos(x) = inverse cosine of x.

Implementation

MathLib uses the built-in JavaScript implementation Math.acos.

Tests

Categories: unary Function