Packagestarling.utils
Classpublic class MathUtil
InheritanceMathUtil Inheritance Object

A utility class containing methods you might need for maths problems.



Public Methods
 MethodDefined By
  
clamp(value:Number, min:Number, max:Number):Number
[static] Moves 'value' into the range between 'min' and 'max'.
MathUtil
  
intersectLineWithXYPlane(pointA:Vector3D, pointB:Vector3D, resultPoint:Point = null):Point
[static] Calculates the intersection point between the xy-plane and an infinite line that is defined by two 3D points in the same coordinate system.
MathUtil
  
normalizeAngle(angle:Number):Number
[static] Moves a radian angle into the range [-PI, +PI], while keeping the direction intact.
MathUtil
Method Detail
clamp()method
public static function clamp(value:Number, min:Number, max:Number):Number

Moves 'value' into the range between 'min' and 'max'.

Parameters

value:Number
 
min:Number
 
max:Number

Returns
Number
intersectLineWithXYPlane()method 
public static function intersectLineWithXYPlane(pointA:Vector3D, pointB:Vector3D, resultPoint:Point = null):Point

Calculates the intersection point between the xy-plane and an infinite line that is defined by two 3D points in the same coordinate system.

Parameters

pointA:Vector3D
 
pointB:Vector3D
 
resultPoint:Point (default = null)

Returns
Point
normalizeAngle()method 
public static function normalizeAngle(angle:Number):Number

Moves a radian angle into the range [-PI, +PI], while keeping the direction intact.

Parameters

angle:Number

Returns
Number