Method |
Description |
Math.PI |
The constant pi, 3.141592653589793 |
Math.E |
Euler's number, 2.718281828459045 |
Math.sqrt(x) |
The square root of x |
Math.abs(x) |
The absolute value of x. |
Math.sin(x) |
The sine of x in radians. |
Math.sin(x*Math.PI/180) |
The sine of x in degrees. |
Math.cos(x) |
The cosine of x in radians. |
Math.tan(x) |
The tangent of x in radians. |
Math.log(x) |
The natural logarithm of x. |
Math.log10(x) |
The log base 10 of x . |
Math.random() |
returns a random number between 0 and 1. |
Other Math methods, including the inverse and hyperbolic trig functions, can be found at