Javascript mathematical functions and javascript mathematical functions
Javascript mathematical functions are actuallyMath objectIt consists of attributes and functions (or methods. The attributes mainly include the following:
Math. e: E (natural logarithm ),Math. LN2(Natural logarithm of 2 ),Math. LN10(The natural logarithm of 10 ),Math. LOG2E(Logarithm of e, base number 2 ),Math. LOG10E(Logarithm of e, base number is 10 ),Math. PI(π ),Math. SQRT1_2(The square root of 1/2 ),Math. SQRT2(The square root of 2 ).
The following 18 functions are available:
(1)AbsFunction: that is, Math. abs (the same as below), returns the absolute value of a number.
(2)AcosFunction: returns the arc cosine of a number. The result is 0 ~ π radians (radians ).
(3)AsinFunction: returns the arc sine of a number. The result is-π/2 ~ π/2 radian.
(4)AtanFunction: returns the arc tangent of a number. The result is-π/2 ~ π/2 radian.
(5)Atan2Function: returns the Polar Coordinate angle value of a coordinate.
(6)CeilFunction: returns the smallest integer (greater than or equal to) of a number ).
(7)CosFunction: returns the cosine of a number. The result is-1 ~ 1.
(8)ExpFunction: returns the multiplier value of e (natural logarithm.
(9)FloorFunction: returns the maximum integer (less than or equal to) of a number ).
(10)LogFunction: natural logarithm function, which returns the natural logarithm (e) value of a number.
(11)MaxFunction: returns the maximum value of two numbers.
(12)MinFunction: returns the minimum value of two numbers.
(13)PowFunction: returns the multiplier value of a number.
(14)RandomFunction: returns a value ranging from 0 ~ A random value of 1.
(15)RoundFunction: returns the rounding value of a number. The type is an integer.
(16)SinFunction: returns the sine of a number. The result is-1 ~ 1.
(17)SqrtFunction: returns the square root of a number.
(18)TanFunction: returns the tangent of a number.