Static tool class to manipulate and transform
Line references.
public static function getLine(p1:Vector2, p2:Vector2):Line
Returns a Line reference defines with the two vectors in argument.
This line is a line equation as two properties (a,b) such that (y = a + b) for any x or a unique c property such that (x = c) for all y.
The function takes two points as parameter, p0 and p1 containing two properties x and y.
Parameters
Returns | Line — a line equation as two properties (a,b) such that (y = a + b) for any x or a unique c property such that (x = c) for all y.
|
public static function getLineCross(l1:Line, l2:Line):Vector2
Returns a point (x,y) that is the intersection of two lines.
A line is defined either by a and b parameters such that (y = a + b) for any x or
a single parameter c such that (x = c) for all y.
Parameters
Returns | Vector2 — a vector (x,y) that is the intersection of two lines.
|
public static function getPointOnSegment(p1:Vector2, p2:Vector2, ratio:Number):Vector2
Returns a point on a segment [p1, p2] which distance from p1 is ratio of the length [p1, p2].
Parameters
Returns | Vector2 — a point on a segment [p1, p2] which distance from p1 is ratio of the length [p1, p2].
|
public static function getVectorLine(p:Vector2, v:Vector2):Line
Returns a line equation as two properties (a,b) such that (y = a + b) for any x or a unique c property such that (x = c) for all y.
The function takes two parameters, a point p(x,y) through which the line passes and a direction vector v(x,y).
Parameters
Returns | Line — a line equation as two properties (a,b) such that (y = a + b) for any x.
|
Mardi Août 16 2011, 02:33 PM +02:00