FlatPoint

open class FlatPoint : Primitive

A weighted position in the plane, or a free vector when at infinity — the 2D flat point.

The grade-2 blade px·e41 + py·e42 + pz·e43. The constructor unitizes finite points to pz = 1, so the stored px, py are the Euclidean coordinates. A weight that rounds to zero places the point at infinity: pure magnitude and orientation with no position (see Direction). Components are stored raw at full Double precision; equals/hashCode compare rounded at the SCALE quantum.

Inheritors

Constructors

Link copied to clipboard
constructor(px: Double, py: Double, pz: Double = 1.0)

Builds the flat point (px, py, pz), unitized and zero-sanitized.

Properties

Link copied to clipboard

The attitude, degenerate for a point — pure weight, no direction.

Link copied to clipboard

Whether this point lies at infinity — a free vector rather than a position.

Link copied to clipboard

The Euclidean magnitude √(px² + py²) — raw.

Link copied to clipboard
val px: Double

The e41 component — the Euclidean x-coordinate when finite.

Link copied to clipboard
val py: Double

The e42 component — the Euclidean y-coordinate when finite.

Link copied to clipboard
val pz: Double

The e43 weight — 1 when finite; rounds to 0 at infinity (kept raw).

Link copied to clipboard

This free vector as a Direction — the refinement carrying the at-infinity guarantee.

Link copied to clipboard

This position as a RoundPoint — the conformal lift.

Functions

Link copied to clipboard

FlatPoint contract RoundPoint => RoundPoint
Returns the flat point's position as a round point sized by minus the squared distance to the given point.

Link copied to clipboard
open fun copy(flatPoint: FlatPoint): FlatPoint

Returns this object rebuilt around the replacement geometry flatPoint — the hook the shape-preserving operations return through.

Link copied to clipboard

FlatPoint distanceTo FlatPoint => Double
Returns the raw Euclidean distance between the two points.

infix fun FlatPoint.distanceTo(line: Line): Double

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.

Link copied to clipboard
infix fun FlatPoint.dot(circle: Circle): Double

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.

infix fun FlatPoint.dot(other: FlatPoint): Double

FlatPoint dot FlatPoint => Double
Returns the raw inner product of two flat points — zero when they coincide, −½·d² for finite points d apart.

infix fun FlatPoint.dot(line: Line): Double

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.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Rounded identity: equal when every component matches at the SCALE quantum.

Link copied to clipboard
infix fun FlatPoint.expand(circle: Circle): Line

FlatPoint expand Circle => Line
Returns the line through the point and the circle's center.

infix fun FlatPoint.expand(line: Line): Line

FlatPoint expand Line => Line
Returns the line through the point perpendicular to the given line.

Link copied to clipboard
open override fun hashCode(): Int

Returns the hash of the rounded components, consistent with equals.

Link copied to clipboard
infix fun FlatPoint.join(other: FlatPoint): Line

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.

infix fun FlatPoint.join(point: RoundPoint): Line

FlatPoint join RoundPoint => Line
Returns the line through the flat point and the round point.

Link copied to clipboard
operator fun FlatPoint.minus(other: FlatPoint): Direction

FlatPoint - FlatPoint => Direction
Returns the free vector from other to this point: the displacement that carries other onto this point.

Link copied to clipboard
infix fun FlatPoint.on(polygon: Polygon): Boolean

FlatPoint on Polygon => Boolean
Returns whether the point lies on the polygon's boundary.

infix fun FlatPoint.on(segment: Segment): Boolean

FlatPoint on Segment => Boolean
Returns whether the point lies on the segment itself, endpoints included.

infix fun FlatPoint.on(circle: Circle): Boolean

FlatPoint on Circle => Boolean
Returns whether the point lies on the circle.

infix fun FlatPoint.on(line: Line): Boolean

FlatPoint on Line => Boolean
Returns whether the point lies on the line.

Link copied to clipboard
infix fun FlatPoint.project(segment: Segment): FlatPoint

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.

infix fun FlatPoint.project(circle: Circle): Dipole

FlatPoint project Circle => Dipole
Returns the dipole where the circle crosses the radial line through the point.

infix fun FlatPoint.project(line: Line): FlatPoint

FlatPoint project Line => FlatPoint
Returns the point's perpendicular foot on the line.

Link copied to clipboard
open override fun toString(): String

Returns the raw components — full stored precision, no rounding.

Link copied to clipboard

Returns the components rounded at the SCALE quantum — the debug-output convention of every primitive.