LineSegment class

A LineSegment represent a segment of an infinitely long line, it is the segment between the from and to vectors (inclusive).

Constructors

LineSegment(Vector2 from, Vector2 to)
LineSegment.withLength({required Vector2 start, required Vector2 direction, required double length})
Creates a LineSegment starting at a given a start point and following a certain direction for a given length.
LineSegment.zero()
factory

Properties

direction Vector2
no setter
from Vector2
final
hashCode int
The hash code for this object.
no setterinherited
length double
no setter
midpoint Vector2
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
to Vector2
final

Methods

containsPoint(Vector2 point, {double epsilon = 0.000001}) bool
intersections(LineSegment otherSegment) List<Vector2>
Returns an empty list if there are no intersections between the segments If the segments are concurrent, the intersecting point is returned as a list with a single point
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pointsAt(Line line) bool
toLine() Line
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited