Motor

class Motor : Versor

A rigid motion of the plane — a rotation about a point, or a translation — applied to a shape with *. Built by the T (translation) and R (rotation) factories.

The even versor mx·e41 + my·e42 + mz·e43 + mw·𝟙, acting via the antiproduct sandwich M ⟇ u ⟇ M̰, spelled shape * motor; Versor carries the right-action and composition contract. Not a Shape: a motor carries a motion, not geometry, and appears only on the right of *.

One type covers both motions because the algebra makes them one family: the generator of a rotation is a weighted finite flat point — the unitized flat point at c antisquares to −𝟙 under ⟇, so its exponential is a CCW rotation about c — while an at-infinity generator antisquares to 0, making the translator the limit: a translation is a rotation about a point at infinity.

The stored form reads Euclidean: with mz non-zero the motor rotates counter-clockwise by θ = 2·atan2(mz, mw) about the center (mx/mz, my/mz); with mz zero it translates by 2·mw·(my, −mx) — mw is ±1 there, +1 for a factory-built translator, −1 for its negation. Components are stored raw at full Double precision, unitized by the flat weight norm √(mz² + mw²); equals/hashCode compare rounded at the SCALE quantum. A motor and its negation apply the identical motion yet compare unequal as values (see Versor).

Constructors

Link copied to clipboard
constructor(mx: Double, my: Double, mz: Double, mw: Double)

Builds the motor (mx, my, mz, mw), unitized and zero-sanitized.

Properties

Link copied to clipboard
val mw: Double

The 𝟙 component — the rotation's half-angle cosine cos(θ/2); ±1 for a translation.

Link copied to clipboard
val mx: Double

The e41 component — sin(θ/2)·cx of a rotation about (cx, cy); −dy/2 of a translation by (dx, dy).

Link copied to clipboard
val my: Double

The e42 component — sin(θ/2)·cy of a rotation about (cx, cy); dx/2 of a translation by (dx, dy).

Link copied to clipboard
val mz: Double

The e43 component — the rotation's half-angle sine sin(θ/2); zero for a translation.

Functions

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
open override fun hashCode(): Int

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

Link copied to clipboard
operator fun Motor.times(next: Flector): Flector

Motor * Flector => Flector
Returns the single flector performing this motion, then next's.

operator fun Motor.times(next: Motor): Motor

Motor * Motor => Motor
Returns the single motor performing this motion, then next's.

operator fun Versor.times(next: Versor): Versor

Versor * Versor => Versor
Returns the single versor performing this motion, then next's.

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 module's debug-output convention.