JS has a built-in object--math object, in some cases very useful, let us analyze:
Math Common Properties (note to capitalize):
e returns the arithmetic constant E, that is, the base of the natural logarithm (approximately equal to 2.718)
LN2 returns 2 of the natural logarithm (about 0.693)
LN10 returns 10 of the natural logarithm (about 2.302)
LOG2E returns the logarithm of the 2-based E (about 1.414)
LOG10E returns the logarithm of the 10-based E (about 0.434)
Pi returns PI (approximately equal to 3.14159)
Sqrt1_2 returns the reciprocal of the square root that returns 2 (approximately equal to 0.707)
SQRT2 returns the square root of 2 (approximately equal to 1.414)
Methods of the Math object
Absolute value of ABS (x) return number
ACOs (x) returns the inverse cosine of the number
ASIN (x) returns the inverse chord value of the number
Atan (x) returns the inverse tangent of x to the value between-PI/2 and PI/2 radians
ATAN2 (y,x) returns the angle (between-PI/2 and PI/2 radians) from the X axis to point (X,y)
Ceil (x) logarithm rounding
COS (x) returns the cosine of a number
EXP (x) returns the exponent of E
Floor (x) logarithmic rounding-– common
Log (x) returns the natural logarithm of the number (bottom e)
Max (X,y) returns the highest value in X and Y
MIN (x,y) returns the lowest value in X and Y
POW (x,y) returns the Y-power of X
Random () returns the random number between 0 ~ 1--Common
Round (x) rounding the number to the nearest integer
Sin (x) returns the sine of a number
SQRT (x) returns the square root of a number
Tan (x) returns the tangent of the angle