Packagegraphics.geom
Classpublic class Lines
InheritanceLines Inheritance Object

Static tool class to manipulate and transform Line references.



Public Methods
 MethodDefined By
  
[static] Returns a Line reference defines with the two vectors in argument.
Lines
  
[static] Returns a point (x,y) that is the intersection of two lines.
Lines
  
[static] Returns a point on a segment [p1, p2] which distance from p1 is ratio of the length [p1, p2].
Lines
  
[static] 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.
Lines
Method Detail
getLine()method
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

p1:Vector2
 
p2:Vector2

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.
getLineCross()method 
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

l1:Line
 
l2:Line

Returns
Vector2 — a vector (x,y) that is the intersection of two lines.
getPointOnSegment()method 
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

p1:Vector2
 
p2:Vector2
 
ratio:Number

Returns
Vector2 — a point on a segment [p1, p2] which distance from p1 is ratio of the length [p1, p2].
getVectorLine()method 
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

p:Vector2
 
v:Vector2

Returns
Line — a line equation as two properties (a,b) such that (y = a + b) for any x.