JavaScript Maths
Mathematical constants
Math.E
The mathematical constant e.
Math.LN10
The mathematical constant loge10.
Math.LN2
The mathematical constant loge2.
Math.LOG10E
The mathematical constant log10e.
Math.LOG2E
The mathematical constant log2e.
Math.PI
The mathematical constant pi.
Math.SQRT1_2
The mathematical constant 1/sqrt(2).
Math.SQRT2
The mathematical constant sqrt(2).
Static Functions
Math.abs(x)
Compute an absolute value.
Math.acos(x)
Compute an arc cosine.
Math.asin(x)
Compute an arc sine.
Math.atan(x)
Compute an arc tangent.
Math.atan2(x,y)
Compute the angle from the X-axis to a point.
Math.ceil(x)
Round a number up.
Math.cos(x)
Compute a cosine.
Math.exp(x)
Compute ex.
Math.floor(x)
Round a number down.
Math.log(x)
Compute a natural logarithm
Math.max(a,b)
Return the larger of two values.
Math.min(a,b)
Return the smaller of two values.
Math.pow(x,y)
Compute xy.
Math.random()
Return a pseudo-random number. Javascript 1.1. ECMA-262.
Math.round(x)
Round to the nearest integer.
Math.sin(x)
Compute a sine.
Math.sqrt(x)
Compute a square root.
Math.tan(x)
Compute a tangent.
