Math | typescript
Options
All
  • Public
  • Public/Protected
  • All
Menu

An intrinsic object that provides basic mathematics functionality and constants.

Hierarchy

  • Math

Index

Properties

E

E: number

The mathematical constant e. This is Euler's number, the base of natural logarithms.

LN10

LN10: number

The natural logarithm of 10.

LN2

LN2: number

The natural logarithm of 2.

LOG10E

LOG10E: number

The base-10 logarithm of e.

LOG2E

LOG2E: number

The base-2 logarithm of e.

PI

PI: number

Pi. This is the ratio of the circumference of a circle to its diameter.

SQRT1_2

SQRT1_2: number

The square root of 0.5, or, equivalently, one divided by the square root of 2.

SQRT2

SQRT2: number

The square root of 2.

Methods

abs

  • abs(x: number): number
  • Returns the absolute value of a number (the value without regard to whether it is positive or negative). For example, the absolute value of -5 is the same as the absolute value of 5.

    Parameters

    • x: number

      A numeric expression for which the absolute value is needed.

    Returns number

acos

  • acos(x: number): number
  • Returns the arc cosine (or inverse cosine) of a number.

    Parameters

    • x: number

      A numeric expression.

    Returns number

asin

  • asin(x: number): number
  • Returns the arcsine of a number.

    Parameters

    • x: number

      A numeric expression.

    Returns number

atan

  • atan(x: number): number
  • Returns the arctangent of a number.

    Parameters

    • x: number

      A numeric expression for which the arctangent is needed.

    Returns number

atan2

  • atan2(y: number, x: number): number
  • Returns the angle (in radians) from the X axis to a point.

    Parameters

    • y: number

      A numeric expression representing the cartesian y-coordinate.

    • x: number

      A numeric expression representing the cartesian x-coordinate.

    Returns number

ceil

  • ceil(x: number): number
  • Returns the smallest integer greater than or equal to its numeric argument.

    Parameters

    • x: number

      A numeric expression.

    Returns number

cos

  • cos(x: number): number
  • Returns the cosine of a number.

    Parameters

    • x: number

      A numeric expression that contains an angle measured in radians.

    Returns number

exp

  • exp(x: number): number
  • Returns e (the base of natural logarithms) raised to a power.

    Parameters

    • x: number

      A numeric expression representing the power of e.

    Returns number

floor

  • floor(x: number): number
  • Returns the greatest integer less than or equal to its numeric argument.

    Parameters

    • x: number

      A numeric expression.

    Returns number

log

  • log(x: number): number
  • Returns the natural logarithm (base e) of a number.

    Parameters

    • x: number

      A numeric expression.

    Returns number

max

  • max(...values: number[]): number
  • Returns the larger of a set of supplied numeric expressions.

    Parameters

    • Rest ...values: number[]

      Numeric expressions to be evaluated.

    Returns number

min

  • min(...values: number[]): number
  • Returns the smaller of a set of supplied numeric expressions.

    Parameters

    • Rest ...values: number[]

      Numeric expressions to be evaluated.

    Returns number

pow

  • pow(x: number, y: number): number
  • Returns the value of a base expression taken to a specified power.

    Parameters

    • x: number

      The base value of the expression.

    • y: number

      The exponent value of the expression.

    Returns number

random

  • random(): number
  • Returns a pseudorandom number between 0 and 1.

    Returns number

round

  • round(x: number): number
  • Returns a supplied numeric expression rounded to the nearest number.

    Parameters

    • x: number

      The value to be rounded to the nearest number.

    Returns number

sin

  • sin(x: number): number
  • Returns the sine of a number.

    Parameters

    • x: number

      A numeric expression that contains an angle measured in radians.

    Returns number

sqrt

  • sqrt(x: number): number
  • Returns the square root of a number.

    Parameters

    • x: number

      A numeric expression.

    Returns number

tan

  • tan(x: number): number
  • Returns the tangent of a number.

    Parameters

    • x: number

      A numeric expression that contains an angle measured in radians.

    Returns number

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc