Package-level declarations
The transform tier: the versors that move shapes — Motor (rotations and translations, built by the T and R factories) and Flector (reflections and glide reflections, built by F and G) — applied with shape * versor and composed with versor * versor. The per-shape actions live in the primitives and composites subpackages; a receiver typed only as Shape moves through the same spelling — the Shape * Versor dispatch delegates to the per-shape actions, preserving the receiver's class.
The factory family
Versors are built by four factories over plain Euclidean and primitive inputs — the half coefficients of the versor representation stay inside the factories, so arguments are true distances, angles, and mirror lines.
| Factory | Result |
|---|---|
T(dx, dy)T(direction) | the translating Motor — by (dx, dy), or by a Direction's free vector |
R(center, angle) | the Motor rotating counter-clockwise by the angle about the center |
F(line) | the Flector reflecting across the line |
G(line, glide) | the Flector reflecting across the line, then gliding glide units along it |
Degenerate inputs: a mirror line at infinity throws DegenerateFlectorException; R about an at-infinity center degrades to a translator, throwing DegenerateMotorException only at a half-turn.
The composition family
Versors compose with * into the single versor performing the left operand's motion first, then the right's. Composition is exactly associative with the action, (u * A) * B == u * (A * B), so a stored composite motion behaves identically to chained applications. Every versor is stored unitized and unitization survives composition, so composing never throws.
| Pairing | Result |
|---|---|
Motor * Motor | Motor — two rigid motions chain into one |
Flector * Flector | Motor — the orientation flips cancel |
Flector * MotorMotor * Flector | Flector — one flip remains |
Versor * Versor | Versor — the dispatch for operands typed as Versor |
Functions
Shape * Versor => Shape
Returns this shape moved by versor.
Flector * Flector => Motor
Returns the single motor performing this motion, then next's.
Flector * Motor => Flector
Returns the single flector performing this motion, then next's.
Motor * Flector => Flector
Returns the single flector performing this motion, then next's.
Motor * Motor => Motor
Returns the single motor performing this motion, then next's.
Versor * Versor => Versor
Returns the single versor performing this motion, then next's.