Packageorg.wak.utils
Classpublic class Utils



Public Methods
 MethodDefined by
  
Utils
  
AlignCenter(pW1:Number, pWContainer:Number):Number
[static] Align a coordinate to be in the center
Utils
  
AngleInTwoPointsP(pX1:Number, pY1:Number, pX2:Number, pY2:Number):Number
[static] Calculate the angle between two differents points.
Utils
  
IsBetween(pVal:Number, pA:Number, pB:Number):Boolean
[static] Check if the value stored pVal is between the values stored in pA and pB
Utils
  
ToDeg(pRad:Number):Number
[static] Converts radians angle value to degrees.
Utils
  
ToRad(pDeg:Number):Number
[static] Converts degrees angle value to radians.
Utils
Constructor detail
Utils()constructor
public function Utils()
Method detail
AlignCenter()method
public static function AlignCenter(pW1:Number, pWContainer:Number):Number

Align a coordinate to be in the center

Parameters
pW1:Number — Width of the contained object
 
pWContainer:Number — width of the container

Returns
Number — the coordinate value to be in the center.
AngleInTwoPointsP()method 
public static function AngleInTwoPointsP(pX1:Number, pY1:Number, pX2:Number, pY2:Number):Number

Calculate the angle between two differents points.

Parameters
pX1:Number — X coordinate of the first point.
 
pY1:Number — Y coordinate of the first point.
 
pX2:Number — X coordinate of the second point.
 
pY2:Number — Y coordinate of the second point.

Returns
Number — The angle between the two points in radians.
IsBetween()method 
public static function IsBetween(pVal:Number, pA:Number, pB:Number):Boolean

Check if the value stored pVal is between the values stored in pA and pB

Parameters
pVal:Number — the value to be tested.
 
pA:Number — the min value of the range.
 
pB:Number — the max value of the range.

Returns
Boolean — true if pVal is between pA and pB else false.
ToDeg()method 
public static function ToDeg(pRad:Number):Number

Converts radians angle value to degrees.

Parameters
pRad:Number — angle in radians to be converted.

Returns
Number — The angle converted to degrees.

See also

ToRad
ToRad()method 
public static function ToRad(pDeg:Number):Number

Converts degrees angle value to radians.

Parameters
pDeg:Number — angle in degrees to be converted.

Returns
Number — The angle converted to radians.

See also

ToDeg