Packageorg.ffilmation.utils
Classpublic class mathUtils

This class provides various useful math methods



Public Methods
 MethodDefined by
  
distance(x1:Number, y1:Number, x2:Number, y2:Number):Number
[static] Distance between two points
mathUtils
  
distance3d(x1:Number, y1:Number, z1:Number, x2:Number, y2:Number, z2:Number):Number
[static] Distance between two points (3d)
mathUtils
  
getAngle(x1:Number, y1:Number, x2:Number, y2:Number, dist:Number = 0):Number
[static]
mathUtils
  
lineIntersectCircle(A:Point, B:Point, C:Point, r:Number):lineCircleIntersectionResult
[static] Finds out if a line an a circle intersect and if so, return the intersection points
source: http://keith-hair.net/blog/2008/08/05/line-to-circle-intersection-data/#more-23
mathUtils
  
linesIntersect(xa:Number, ya:Number, xb:Number, yb:Number, xc:Number, yc:Number, xd:Number, yd:Number):Point
[static] Find out if two lines intersect and if so, retrieve the point of intersection.
Source: http://members.shaw.ca/flashprogramming/wisASLibrary/wis/math/geom/intersect2D/Intersect2DLine.as
mathUtils
  
segmentsIntersect(xa:Number, ya:Number, xb:Number, yb:Number, xc:Number, yc:Number, xd:Number, yd:Number):Point
[static] Find out if two segments intersect and if so, retrieve the point of intersection.
Source: http://vision.dai.ed.ac.uk/andrewfg/c-g-a-faq.html
mathUtils
Method detail
distance()method
public static function distance(x1:Number, y1:Number, x2:Number, y2:Number):Number

Distance between two points

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

Returns
Number
distance3d()method 
public static function distance3d(x1:Number, y1:Number, z1:Number, x2:Number, y2:Number, z2:Number):Number

Distance between two points (3d)

Parameters
x1:Number
 
y1:Number
 
z1:Number
 
x2:Number
 
y2:Number
 
z2:Number

Returns
Number
getAngle()method 
public static function getAngle(x1:Number, y1:Number, x2:Number, y2:Number, dist:Number = 0):NumberParameters
x1:Number
 
y1:Number
 
x2:Number
 
y2:Number
 
dist:Number (default = 0)

Returns
Number
lineIntersectCircle()method 
public static function lineIntersectCircle(A:Point, B:Point, C:Point, r:Number):lineCircleIntersectionResult

Finds out if a line an a circle intersect and if so, return the intersection points
source: http://keith-hair.net/blog/2008/08/05/line-to-circle-intersection-data/#more-23

Parameters
A:Point
 
B:Point
 
C:Point
 
r:Number

Returns
lineCircleIntersectionResult — An lineCircleIntersectionResult with the results of the calculation
linesIntersect()method 
public static function linesIntersect(xa:Number, ya:Number, xb:Number, yb:Number, xc:Number, yc:Number, xd:Number, yd:Number):Point

Find out if two lines intersect and if so, retrieve the point of intersection.
Source: http://members.shaw.ca/flashprogramming/wisASLibrary/wis/math/geom/intersect2D/Intersect2DLine.as

Parameters
xa:Number
 
ya:Number
 
xb:Number
 
yb:Number
 
xc:Number
 
yc:Number
 
xd:Number
 
yd:Number

Returns
Point — the Point of intersection
segmentsIntersect()method 
public static function segmentsIntersect(xa:Number, ya:Number, xb:Number, yb:Number, xc:Number, yc:Number, xd:Number, yd:Number):Point

Find out if two segments intersect and if so, retrieve the point of intersection.
Source: http://vision.dai.ed.ac.uk/andrewfg/c-g-a-faq.html

Parameters
xa:Number
 
ya:Number
 
xb:Number
 
yb:Number
 
xc:Number
 
yc:Number
 
xd:Number
 
yd:Number

Returns
Point — the Point of intersection