Dipole

open class Dipole : Primitive

Two points of the plane joined into a single oriented object — the 2D dipole.

The grade-2 blade gx·e23 + gy·e31 + gz·e12 + px·e41 + py·e42 + pz·e43, the wedge of two round points. The constructor unitizes by the round weight ‖(gx, gy)‖ — the distance between the endpoints — and rejects component sets violating the Plücker blade constraint. The endpoints are recovered as start and end, with the line through them, their midpoint and their half-distance as first-class views (carrier, center, radius); the wedge rebuilds the blade: start ∧ end == this. A negative radius2 makes the dipole imaginary — no real endpoints, first-class data, never an error (see isImaginary). Orientation is data: swapping the endpoints negates every component and equals distinguishes them (canonical for unoriented equivalence). A round weight that rounds to zero leaves the dipole at infinity, all six components raw (isAtInfinity). Components are stored raw at full Double precision; equals/hashCode compare rounded at the SCALE quantum.

Constructors

Link copied to clipboard
constructor(gx: Double, gy: Double, gz: Double, px: Double, py: Double, pz: Double)

Builds the dipole (gx, gy, gz, px, py, pz), unitized, zero-sanitized, and blade-checked.

Properties

Link copied to clipboard

The direction from start toward end — a round point at infinity.

Link copied to clipboard
open val canonical: Dipole

The canonical representative of this dipole — useful for unoriented equivalence.

Link copied to clipboard

The line through both points — the carrier car(d) = e4 ∧ d.

Link copied to clipboard

The midpoint of the endpoints, carrying the dipole's size — a RoundPoint.

Link copied to clipboard

The center's distance from the origin √(gz² + pz²) — raw.

Link copied to clipboard

The co-carrier — the perpendicular bisector of the endpoints.

Link copied to clipboard

The smallest circle containing this dipole — the endpoints as a diameter.

Link copied to clipboard

The second endpoint — center + radius·attitude.

Link copied to clipboard
val gx: Double

The e23 component — the carrier line's unit-normal x-component when finite.

Link copied to clipboard
val gy: Double

The e31 component — the carrier line's unit-normal y-component when finite.

Link copied to clipboard
val gz: Double

The e12 component — the carrier line's signed origin distance when finite.

Link copied to clipboard

Whether this dipole lies at infinity — a purely directional object rather than two points in the plane.

Link copied to clipboard

Whether this dipole is imaginary — a negative squared radius, no real endpoints.

Link copied to clipboard

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

Link copied to clipboard
val px: Double

The e41 component — the flat bulk's x-component; with py and pz it fixes the endpoints' placement along the carrier.

Link copied to clipboard
val py: Double

The e42 component — the flat bulk's y-component; with px and pz it fixes the endpoints' placement along the carrier.

Link copied to clipboard
val pz: Double

The e43 component — minus the center's signed offset along attitude when finite.

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

Link copied to clipboard

The first endpoint — center − radius·attitude.

Link copied to clipboard

A fresh Segment wrapping this dipole — the promotion across the algebra/composite boundary.

Functions

Link copied to clipboard

Dipole contract RoundPoint => RoundPoint
Returns the center of the circle that swaps the dipole's endpoints through the point, carrying that circle's squared radius negated.

Link copied to clipboard
open fun copy(dipole: Dipole): Dipole

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

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

Rounded, orientation-sensitive identity: equal when every component matches at the SCALE quantum.

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

Dipole expand Circle => Circle
Returns the circle through the dipole's endpoints that crosses the circle at right angles.

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

Dipole expand Line => Circle
Returns the circle through the dipole's endpoints that crosses the line at right angles.

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 Dipole.join(point: RoundPoint): Circle

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

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

Dipole project Circle => Dipole
Returns the dipole where the circle meets the circle through this dipole's endpoints orthogonal to it.

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

Dipole project Line => Dipole
Returns the dipole where the line cuts the circle through this dipole's endpoints centered on 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.