math()

The math object is used to contain a library of mathematical constant values or operations, or both. Basically, it is an object which contains the properties and methods you are using in your computations. It is a static object, as are its properties and methods, so there is no contructor function.

syntax:

math.propertyName

math.method( parameterOne, [ parameterTwo ] )

EXAMPLE

var returnLOG10 = math.LN10

This example loads the value for the natural logarithm of 10, which is 2.303585092994046, into the variable 'returnLOG10'.

The Properties of the math Object are:

• E

• LN2

• LN10

• LOG2E

• LOG10E

• PI

• SQRT1_2

• SQRT2

The Methods of the math Object are:

• abs()

• acos()

• asin()

• atan()

• atan2()

• ceil()

• cos()

• exp()

• floor()

• log()

• max()

• min()

• pow()

• random()

• round()

• sin()

• sqrt()

• tan()