Ray class

A ray defined by an origin point and a direction.

A ray starts at origin and extends infinitely in the direction of direction. Unlike Line, a ray has no endpoint.

Constructors

Ray(Point origin, Point direction)
const
Ray.fromAngle(Point origin, double deg)
Create a ray from an origin point and an angle in degrees
factory

Properties

direction Point
The direction of the ray as a point (vector from origin)
final
hashCode int
The hash code for this object.
no setteroverride
normalizedDirection Point
Get the normalized direction vector
no setter
origin Point
The starting point of the ray
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

intersectsCircle(Circle circle) List<Point>
Get intersection points of this ray with a Circle.
intersectsLine(Line line) Point?
Get the intersection point of this ray with a Line segment.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pointAt(double t) Point
Get a point along the ray at parameter t
rotate(double deg) Ray
Rotate the ray by deg degrees
toString() String
A string representation of this object.
override
translate({double x = 0, double y = 0}) Ray
Translate the ray origin

Operators

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