LineSegment class

A directed line segment between two Points in Screen pixels.

Constructors

LineSegment(Mappoint start, Mappoint end)
Ctor with given start and end point
LineSegment.direction(Mappoint start, Mappoint direction, double distance)
Ctor with given start point, a point that defines the direction of the line and a length

Properties

end → Mappoint
final
hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
start → Mappoint
final

Methods

angleTo(LineSegment other) double
Computes the angle between this LineSegment and another one.
clipToRectangle(Rectangle<num> r) LineSegment?
Intersection of this LineSegment with the Rectangle as another LineSegment.
getAngle() double
Returns the degree of this segment. 0 means vector to the right side --> Since positive values in y-direction points towards the bottom of the screen the angle runs clockwise.
getTheta() double
Returns the theta of this segment in radians. 0 means vector to the right side --> Since positive values in y-direction points towards the bottom of the screen the angle runs clockwise. see https://de.wikipedia.org/wiki/Arkustangens_und_Arkuskotangens#/media/Datei:Arctangent.svg
intersectsRectangle(Rectangle<num> r, bool bias) bool
Returns a fast computation if the line intersects the rectangle or bias if there is no fast way to compute the intersection.
length() double
Euclidian distance between start and end.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pointAlongLineSegment(double distance) → Mappoint
Computes a Point along the line segment with a given distance to the start Point.
reverse() LineSegment
New line segment with start and end reversed.
subSegment(double offset, [double length = -1]) LineSegment
LineSegment that starts at offset from start and runs for length towards end point
toDegrees(double var0) double
Returns the degree given by the radian value
toString() String
A string representation of this object.
override

Operators

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

Static Properties

BOTTOM int
getter/setter pair
INSIDE int
getter/setter pair
LEFT int
getter/setter pair
getter/setter pair
TOP int
getter/setter pair

Static Methods

code(Rectangle<num> r, Mappoint p) int
Computes the location code according to Cohen-Sutherland, see https://en.wikipedia.org/wiki/Cohen%E2%80%93Sutherland_algorithm.