NumberUtil
static public TWO_PI:Number [Read Only]static public PI:Number [Read Only]static public HALF_PI:Number [Read Only]static public TO_DEGREE:Number [Read Only]static public TO_RADIAN:Number [Read Only]static public TOL:Numberstatic public function isZero(n:Number):BooleanSay if a Number is close enought to zero to ba able to say it's zero. Adjust TOL property depending on the precision of your Application
n | Number The number to compare with zero |
Boolean true if the Number is comparable to zero, false otherwise.
static public function areEqual(n:Number, m:Number):BooleanSay if a Number is close enought to another to ba able to say they are equal. Adjust TOL property depending on the precision of your Application
n | Number The number to compare m |
m | Number The number you want to compare with n |
Boolean true if the numbers are comparable to zero, false otherwise.
static public function toDegree(n:Number):NumberConvert an angle from Radians to Degrees unit
n | Number Number representing the angle in radian |
Number The angle in degrees unit
static public function toRadian(n:Number):NumberConvert an angle from Degrees to Radians unit
n | Number Number representing the angle in dregrees |
Number The angle in radian unit
static public function constrain(n:Number, min:Number, max:Number):NumberAdd a constrain to the number which must be between min and max values. Usually name clamp ?
n | Number The number to constrain |
min | Number The minimal valid value |
max | Number The maximal valid value |
Number The number constrained
static public function roundTo(n:Number, roundToInterval:Number):NumberRound a number to specified accuracy
n | Number The number to round |
roundToInterval | Number The accuracy to which to round (i.e., set roundInterval to 0.01 to round 2 to decimal places) |
Number The rounded number