Direction
A free vector — magnitude and orientation with no position; the FlatPoint refinement guaranteed to lie at infinity.
The at-infinity flat point dx·e41 + dy·e42, its weight stored as exact 0.0 — not merely a value that rounds to zero at the SCALE quantum — so even the raw arithmetic of the operations cannot leak a position back in. A free vector doubles as a displacement: its length the distance, its orientation the heading. The refinement adds no data, only the guarantee: a direction and a plain FlatPoint carrying the same components are the same value and compare equal, in both directions (see FlatPoint.equals). FlatPoint.toDirection converts a computed flat point, admitting exactly the points at infinity.
Parameters
The e41 component: the vector's x-extent.
The e42 component: the vector's y-extent.
Constructors
Properties
The attitude, degenerate for a point — pure weight, no direction.
Whether this point lies at infinity — a free vector rather than a position.
This free vector as a Direction — the refinement carrying the at-infinity guarantee.
This position as a RoundPoint — the conformal lift.
Functions
FlatPoint contract RoundPoint => RoundPoint
Returns the flat point's position as a round point sized by minus the squared distance to the given point.
FlatPoint distanceTo FlatPoint => Double
Returns the raw Euclidean distance between the two points.
FlatPoint distanceTo Line => Double
Returns the raw perpendicular distance from the point to the line.
FlatPoint distanceTo RoundPoint => Double
Returns the raw Euclidean distance between the flat point and the round point's position.
FlatPoint dot Circle => Double
Returns the raw point-against-circle probe: positive inside, zero on the circle, negative outside, for a finite point and a classic circle.
FlatPoint dot FlatPoint => Double
Returns the raw inner product of two flat points — zero when they coincide, −½·d² for finite points d apart.
FlatPoint dot Line => Double
Returns the line's equation evaluated at the point: zero when the point lies on the line, the raw signed distance to it otherwise.
FlatPoint join FlatPoint => Line
Returns the line through both points, oriented so its normal points to the left of the travel from this point to other.
FlatPoint join RoundPoint => Line
Returns the line through the flat point and the round point.
Direction - Direction => Direction
Returns the vector difference of the two free vectors: this displacement with other undone.
FlatPoint on Polygon => Boolean
Returns whether the point lies on the polygon's boundary.
FlatPoint on Segment => Boolean
Returns whether the point lies on the segment itself, endpoints included.
FlatPoint on Circle => Boolean
Returns whether the point lies on the circle.
FlatPoint on Line => Boolean
Returns whether the point lies on the line.
FlatPoint project Segment => FlatPoint
Returns the point of the segment nearest to this point: the perpendicular foot when it falls within the segment, else the nearer endpoint.
FlatPoint project Circle => Dipole
Returns the dipole where the circle crosses the radial line through the point.
FlatPoint project Line => FlatPoint
Returns the point's perpendicular foot on the line.
Returns the components rounded at the SCALE quantum — the debug-output convention of every primitive.
-Direction => Direction
Returns the opposite free vector: the same length, reversed heading.