RoundDirection

class RoundDirection(dx: Double, dy: Double, aw: Double = 0.0) : RoundPoint

A direction with magnitude — the RoundPoint refinement guaranteed to lie at infinity; the round-point counterpart of Direction.

The at-infinity round point dx·e1 + dy·e2 + aw·e4, its round weight stored as exact 0.0 — not merely a value that rounds to zero at the SCALE quantum. The guarantee covers only the weight: the conformal component aw is live data — a computed at-infinity point can carry meaning there (a dipole's attitude does), and the operations that move round points move it honestly. RoundPoint.toRoundDirection converts a computed round point, admitting exactly the points at infinity. The refinement adds no data, only the guarantee: a round direction and a plain RoundPoint carrying the same components are the same value and compare equal, in both directions (see RoundPoint.equals).

Parameters

dx

The e1 component: the vector's x-extent.

dy

The e2 component: the vector's y-extent.

aw

The e4 conformal component; defaults to 0.0.

Constructors

Link copied to clipboard
constructor(dx: Double, dy: Double, aw: Double = 0.0)

Builds the direction (dx, dy) with conformal component aw; the zero direction is legal.

Properties

Link copied to clipboard

The heading of this direction — its raw polar angle, measured counter-clockwise from the positive X direction, in (−180°, 180°].

Link copied to clipboard

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

Link copied to clipboard
val aw: Double

The e4 conformal component — (ax² + ay²)/2 for a plain Euclidean point.

Link copied to clipboard
val ax: Double

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

Link copied to clipboard
val ay: Double

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

Link copied to clipboard
val az: Double

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

Link copied to clipboard

The flat point at this position — the carrier car(a) = e4 ∧ a.

Link copied to clipboard

The co-carrier, degenerate for a point — just its weight az.

Link copied to clipboard

The smallest circle containing this point — zero radius for a plain Euclidean point.

Link copied to clipboard

Whether this point lies at infinity — a direction with magnitude rather than a position.

Link copied to clipboard

Whether this point is imaginary — a negative squared radius, no real locus.

Link copied to clipboard

The Euclidean magnitude √(ax² + ay²) — raw.

Link copied to clipboard

The radius magnitude √(|radius2|) — raw, non-negative.

Link copied to clipboard

The squared radius — raw and signed; negative for an imaginary point.

Link copied to clipboard

This position as a FlatPoint — drops the conformal component.

Link copied to clipboard

This direction as a RoundDirection — the refinement carrying the at-infinity guarantee.

Functions

Link copied to clipboard
open override fun copy(roundPoint: RoundPoint): RoundDirection

Returns this object rebuilt around the replacement geometry roundPoint — the hook the shape-preserving operations return through, re-establishing the at-infinity guarantee.

Link copied to clipboard
infix fun RoundPoint.distanceTo(flatPoint: FlatPoint): Double

RoundPoint distanceTo FlatPoint => Double
Returns the raw Euclidean distance between the round point's position and the flat point.

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

RoundPoint distanceTo Line => Double
Returns the raw perpendicular distance from the point's position to the line.

RoundPoint distanceTo RoundPoint => Double
Returns the raw Euclidean distance between the two points' positions.

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

RoundPoint 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 RoundPoint.dot(line: Line): Double

RoundPoint 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.

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

RoundPoint dot RoundPoint => Double
Returns the raw inner product of two round points — zero when two finite positions coincide, −½·d² when they sit d apart.

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 RoundPoint.expand(circle: Circle): Dipole

RoundPoint expand Circle => Dipole
Returns the dipole holding the point and its inversion through the circle.

infix fun RoundPoint.expand(dipole: Dipole): Circle

RoundPoint expand Dipole => Circle
Returns the circle through the point whose inversion swaps the dipole's endpoints.

infix fun RoundPoint.expand(flatPoint: FlatPoint): Circle

RoundPoint expand FlatPoint => Circle
Returns the circle through the round point centered at the flat point.

infix fun RoundPoint.expand(line: Line): Dipole

RoundPoint expand Line => Dipole
Returns the dipole holding the point and its mirror image across the 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 RoundPoint.join(segment: Segment): Circle

RoundPoint join Segment => Circle
Returns the circle through the segment's endpoints and this point.

infix fun RoundPoint.join(dipole: Dipole): Circle

RoundPoint join Dipole => Circle
Returns the circle through the point and the dipole's endpoints.

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

RoundPoint join FlatPoint => Line
Returns the line through both points.

infix fun RoundPoint.join(other: RoundPoint): Dipole

RoundPoint join RoundPoint => Dipole
Returns the dipole holding both points — this point as Dipole.start, other as Dipole.end.

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

RoundPoint - RoundPoint => Direction
Returns the free vector from other's position to this point's position: the displacement that carries other onto this point.

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

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

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

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

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

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

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

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

Link copied to clipboard
infix fun RoundPoint.project(circle: Circle): RoundPoint

RoundPoint project Circle => RoundPoint
Returns the round point that pairs the point into the circle: on the radial line through the point, incident with the circle.

infix fun RoundPoint.project(dipole: Dipole): RoundPoint

RoundPoint project Dipole => RoundPoint
Returns the point of the dipole's carrier dividing the endpoints in the ratio of their squared distances from the given point.

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

RoundPoint project Line => RoundPoint
Returns the point's perpendicular foot on the line, sized by the squared distance to it.

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.

Link copied to clipboard

-RoundDirection => RoundDirection
Returns the opposite direction: the same magnitude, reversed heading.