A collection of useful general purpose mathematical functions.
Properties
pi |
Returns PI as a float. |
infinity |
Returns the floating point value of +INF. |
Methods
degToRad(angle) |
Returns an angle converted from degrees to radians. |
radToDeg(angle) |
Returns an angle converted from radians to degrees. |
randomIntRange(from,to) |
Returns an integer in the range from low to high inclusive. |
randomSeed(seed) |
Initialize the UtilMath random number generator with an integer seed (if you don't supply a parameter, it will initialize with the pc's timer). |
angleChangeDegrees(from, to) |
Returns a float for the difference in degrees between two headings/angles. This allows for the wrap around at 360.0, so the change between 350.0 and 10.0 is 20.0. |
Examples
var myval=UtilMath.degToRad(90.0); // 90 degress returned in radians
See Also


