Members
-
<static> GOLDEN_ANGLE :number
-
Constant: golden angle.
- Source:
-
<static> HALFPI :number
-
Constant: half pi.
- Source:
-
<static> TWOPI :number
-
Constant: 2pi.
- Source:
Methods
-
<static> almostEqual(a, b, threshold) → {Boolean}
-
Checks two numbers to see if almost equal.
Parameters:
- this is particularly useful for physics systems that make small stepsName Type Description a
Number number a b
Number number b threshold
Number threshold beyond which numbers are not considered equal - Source:
{ Boolean } true if numbers are within threshold of each other -
<static> clamp(n, min, max) → {Number}
-
Clamps a number between and min and max.
Parameters:Name Type Description n
Number number. min
Number min value. max
Number max value. - Source:
{ Number } limited number -
<static> degreesToRadians(n) → {Number}
-
Converts degrees to radians,
Parameters:Name Type Description n
Number degress. - Source:
{ Number } radians -
<static> direction(n) → {Number}
-
Checks the direction of a number.
Parameters:Name Type Description n
Number number. - Source:
{ Number } -1, 0, or 1 -
<static> directionChange(a, b) → {Boolean}
-
Checks two numbers to see if a change in direction has occured.
Parameters:Name Type Description a
Number number a. b
Number number b. - Source:
{ Boolean } true if numbers are on opposite sides of zero, or one is 0 and other is not -
<static> map(n, istart, istop, ostart, ostop) → {Number}
-
Maps an interval number to start and stop values.
Parameters:Name Type Description n
Number number. istart
Number interval start. istop
Number interval stop. ostart
Number start. ostop
Number stop. - Source:
{ Number } mapped number -
<static> oppositeSidesOfZero(a, b) → {Boolean}
-
Checks two numbers to see if on opposite sides of zero.
Parameters:Name Type Description a
Number number a. b
Number number b. - Source:
{ Boolean } true if numbers are on opposite sides of zero -
<static> radiansToDegrees(n) → {Number}
-
Converts radians to degress,
Parameters:Name Type Description n
Number radians. - Source:
{ Number } degrees