Packageorg.MARS.util
Classpublic class MathUtil

Useful mathematic functions



Public Methods
 MethodDefined by
  
clamp(low:Number, high:Number, value:Number):Number
[static] Clamp the given value withing the given boundaries
MathUtil
  
degreesToRadians(x:Number):Number
[static] Convert degrees to radians
MathUtil
  
distance(x1:Number, x2:Number, y1:Number, y2:Number):Number
[static] Calculate the distance between the given points
MathUtil
Method detail
clamp()method
public static function clamp(low:Number, high:Number, value:Number):Number

Clamp the given value withing the given boundaries

Parameters
low:Number
 
high:Number
 
value:Number

Returns
Number — clamped value
degreesToRadians()method 
public static function degreesToRadians(x:Number):Number

Convert degrees to radians

Parameters
x:Number — - number of degrees

Returns
Number — number of radians
distance()method 
public static function distance(x1:Number, x2:Number, y1:Number, y2:Number):Number

Calculate the distance between the given points

Parameters
x1:Number
 
x2:Number
 
y1:Number
 
y2:Number

Returns
Number — distance