Mathematical
constants |
Javascript |
Value |
Math.E
Math.LN10
Math.LN2
Math.LOG10E
Math.LOG2E
Math.PI
Math.SQRT1_2
Math.SQRT2 |
e=2.718...
ln(10)=2.3025...
ln(2)=0.693...
log10e=0.434...
log2e=1.44...
pi=3.14159...
1/sqrt(2)=0.707...
sqrt(2)=1.414... |
|
Mathematical functions |
Javascript |
function |
Math.abs(x)
Math.acos(x)
Math.asin(x)
Math.atan(x)
Math.atan2(y,x)
Math.ceil(x)
Math.cos(x)
Math.exp(x)
Math.floor(x)
Math.log(x)
Math.max(x,y)
Math.min(x,y)
Math.pow(x,y)
Math.random()
Math.round(x)
Math.sin(x)
Math.sqrt(x)
Math.tan(x) |
absolute value of x
arccosine of x in radians
arcsin of x in radians
arctan of x in radians
arctan of y/x in radians (polar coordinates)
smallest integer >= x
cosine of x
ex
largest integer <= x
ln(x)
greater of x and y
lesser of x and y
xy
psuedo-random number on (0,1)
rounds to nearest integer
sine of x
square root of x
tangent of x
|
|