The algebra's objects are the set of points P on the plane, together with the associated Euclidean space V (that is, a vector space together with an inner product and the usual Euclidean metric), where directed line segments between points in P are identified with free vectors (in other words, V = P/∗, for ∗ ∈ P distinguished). In what follows, I denote points by P, Q, R, vectors by u, v, w and scalars by k, l, m. Functional application (of which subscription is but a special case) is denoted by a dot, it is left-associative, and it is given the highest binding power. Labeled formulas are implicitly universally quantified over their free variables, whose type is usually understood if not declared beforehand.
The point constructor:
• → •: P → V → P
and the vector constructor:
‹• − •›: P → P → V
are the only operations on points. They are related by the following axioms:
By (0) the null vector is the identity translation. By (1), the tail of an anchored vector translated by itself is its head. (2) is the parallellogram rule for adding vectors. (3) is the associative rule for vector addition.
From these, it follows as theorems that:
(4) 〈∑ i : 0 ≤ i < N : ‹P.((i+1) mod N) − P.i›〉 = 0 (5) ‹Q − P› = −‹P − Q› (6) ‹P − P› = 0 (7) P → ‹Q − Q› = P (8) P → u → v = P → v → u (9) ‹(P → u) − (Q → v)› = ‹P − Q› + u − v
Formula (4), the chain rule means simply that following along a closed polygonal line returns to the starting point. By (5), segments, when considered as vectors, are oriented; and by (8) vector addition is commutative.
Proofs: (4) follows from proving:P.0 → 〈∑ i : 0 ≤ i < N : ‹P.((i+1) mod N) − P.i›〉 = P.0
The algebra is also equipped with a unary postfix operator, the perp:
•⊥: V → V
satisfying the following axioms:
From the axioms, these theorems follow:
where -π <
θ.u.v ≤ π is the CCW angle from u to v.
By (10) and (11), perp is a linear operator; by (12) it is hemi-Hermitian, and by (13) it is magnitude-preserving. From (14), u⊥ is perpendicular to u (hence the name). There are then only two possibilities for u⊥; the definition of
θ fixes it by convention as the CCW one.
These operations form a kind of typed domain-specific language (DSL) for doing simple plane geometry. The fact that the operators are typed greatly constrains the allowed expressions, paradoxically making proofs by uninterpreted formula manipulation much easier.
- F. S. Hill, Jr. The Pleasures of
Perp DotProducts. In Paul S. Heckbert ed. Graphics Gems IV