An infinite 2D line going through two specified Points.

Constructor

inlinenew(p1:Point, p2:Point)

Create a new Line instance.

Parameters:

p1

The first line point.

p2

The second line point.

Variables

p1:Point

The first line point.

p2:Point

The second line point.

Methods

inlineangle():Float

The angle between a line and the x-axis

inlinedistance(p:Point):Float

Returns a distance from Line axis to Point p.

inlinedistanceSq(p:Point):Float

Returns a squared distance from Line axis to Point p. Cheaper to calculate than distance and can be used for more optimal comparison operations.

inlineintersect(l:Line):Null<Point>

Returns an intersection Point between given Line l and this Line with both treated as infinite lines. Returns null if lines are almost colinear (less than epsilon value difference)

inlineintersectWith(l:Line, pt:Point):Bool

Tests for intersection between given Line l and this Line with both treated as infinite lines. Returns false if lines are almost colinear (less than epsilon value difference). Otherwise returns true, and fill Point pt with intersection point.

inlinelength():Float

The distance between Line starting Point p1 and ending Point p2.

inlineproject(p:Point):Point

Projects Point p onto the Line axis and return new Point instance with a result.

inlineside(p:Point):Float

Returns a positive value if Point p is on the right side of the Line axis and negative if it's on the left.