Help

JS-MATH

For immortals Also: JAVASCRIPT-MATH

Arcane Ages defines the standard JavaScript Math class which provides a variety of numerical functionality.

Class Properties:

E                    The constant e, the base of the natural logarithms.
LN2                  The natural logarithm of 2.
LN10                 The natural logarithm of 10.
LOG2E                The base-2 logarithm of e.
LOG10E               The base-10 logarithm of e.
PI                   The constant pi.
SQRT1_2              1 divided by the square root of 2.
SQRT2                The square root of 2.

Class Methods:

abs()                Computes an absolute value.
acos()               Computes an arc cosine.
asin()               Computes an arc sine.
atan()               Computes an arc tangent.
atan2()              Computes the angle from the X-axis to a point.
ceil()               Computes a ceiling (rounds up).
cos()                Computes a cosine.
exp()                Computes an exponent of e.
floor()              Computes a floor (rounds down).
log()                Computes a natural logarithm.
max()                Computes the largest of any number of numbers.
min()                Computes the smallest of any number of numbers.
pow()                Computes x^y
random()             Computes a random number. 
round()              Rounds to the nearest integer.
sin()                Computes a sine.
sqrt()               Computes a square root.
tan()                Computes a tangent.

Arcane Ages Extension Class Methods:

cosh()               Hyperbolic cosine function.
sinh()               Hyperbolic sine function.
tanh()               Hyperbolic tangent function.
acosh()              Inverse hyperbolic cosine function.
asinh()              Inverse hyperbolic sine function.
atanh()              Inverse hyperbolic tangent function.
factorial( n )       Returns the factorial of n.
between( l, m, h )   Returns true if l <= m <= h, false otherwise.
bound( l, m, h )     If m is between l and h, it returns m, otherwise
                     it returns l if m < l or h if m > h.
odds( perc )         Returns true perc% of the time.  (Example:
                     Math.odds( 1.5 ) is true 1.5% of the time.)