MathLib.tan()

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

Examples

To calculate the tangent of 2 type: MathLib.tan(2);

Specification

MathLib.tan 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.tan(NaN) = NaN
  • MathLib.tan(+0) = +0
  • MathLib.tan(-0) = -0
  • MathLib.tan(+∞) = NaN
  • MathLib.tan(-∞) = NaN
  • otherwise MathLib.tan(x) = tangent of x

Implementation

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

Possible issues

MathLib expects the input argument to be in radians. If you want to insert the angle in degrees (let's say 60°), use:

Tests

Categories: unary Function