Projective & Conformal Geometric Algebra (kingdon vs galgebra)¶
Repositories:
_refs/kingdon(https://github.com/tBuLi/kingdon, MIT, Gunn2020) &_refs/galgebra(https://github.com/pygae/galgebra, BSD-3-Clause)Mathematical Foundation: Hermann Günther Grassmann & William Kingdon Clifford multivector calculi—Plane-Based 2D Projective Geometric Algebra \(\mathbb{R}_{2,0,1}^*\) and Point-Based 2D Conformal Geometric Algebra \(\mathbb{R}_{3,1}\) (DorstFontijneMann2007)
1. Two Covariant Calculi: 2D PGA vs. 2D CGA¶
Clifford algebra replaces ad-hoc vector cross/dot formulas with a single associative geometric product u * v = (u | v) + (u ^ v) over graded blades:
Plane-Based 2D PGA (`Algebra(2, 0, 1)`): Basis \(e_1^2 = e_2^2 = 1, \; e_0^2 = 0\) (e0 is the ideal line at infinity).
Grade-1 vectors are Lines: \(\ell = a e_1 + b e_2 + c e_0\).
Grade-2 bivectors are Points & Ideal Directions: \(P = e_{12} + x e_{20} + y e_{01}\) (finite point) vs. \(D = dx\,e_{20} + dy\,e_{01}\) (ideal point at infinity, weight \(e_{12} = 0\)!).
Division-Free Incidence & Metric:
l1 ^ l2is the meet of two lines (valid even when parallel!);P1 & P2is the join of two points;(l | P)is the line throughPperpendicular tol; andl >> Xreflects any point or line acrossl!
Point-Based 2D CGA (`Algebra(3, 1)`): Lifts 2D Euclidean point \((x, y)\) onto the 4D Minkowski null cone (\(n_o^2 = n_\infty^2 = 0, \; n_o \cdot n_\infty = -1\)):
\[P = x e_1 + y e_2 + \tfrac{1}{2}(x^2 + y^2)n_\infty + n_o, \qquad -2(P_1 \mid P_2) = (x_1 - x_2)^2 + (y_1 - y_2)^2 = Q(P_1, P_2)\]In 2D CGA (kingdon with SymPy symbolic scalars), circle geometry collapses to 1-line linear/versor expressions:
C_circ = P1 ^ P2 ^ P3 # OPNS grade-3 circle through 3 points! X3 = norm_pt(C_circ * ni * ~C_circ) # Circumcenter = reflection of infinity ni! kappa1 = C1.dual() # IPNS grade-1 dual circle O - (1/2)r^2 ni power_P = -2 * (kappa1 | P).e # Steiner power of P wrt C1! lam_rad = kappa1 - kappa2 # Radical axis of ANY two circles (even disjoint)! P_inv = norm_pt(C1.normalized() >> P) # Möbius circle inversion = sandwich product!
2. Forensic Audit: Three Critical Traps in galgebra¶
Comparing kingdon and galgebra source code side-by-side exposed three severe pitfalls in galgebra (mv.py) for projective geometry:
Crash on Degenerate PGA Duality (`galgebra/mv.py:1104`): Calling
A.dual()computesself * self.ga.I_inv(), which raisesAttributeError: 'Ga' object has no attribute 'i_inv'whenever \(I^2 = 0\)—breaking Poincaré duality across all degenerate Projective Geometric Algebras (Cl(2,0,1) and Cl(3,0,1))!kingdon(operators.py:390-440) dispatches cleanly to the metric-free right Hodge complement whenever \(r \ge 1\).Missing Regressive Join ``&``:
galgebraimplements^(outer) and|(inner), but has no regressive vee join ``&``, preventing standard plane-based PGA point-joiningP1 & P2.Silent Operator Trap on ``>>``: In
kingdon,V >> Xis the versor sandwich product \(\pm V X \widetilde{V}\). Ingalgebra(mv.py:809),A >> Bis the commutator product \(\tfrac{1}{2}(AB - BA)\)! WritingL >> Pingalgebrasilently computes a Lie-bracket commutator instead of a reflection!
Furthermore, kingdon (polynomial.py, codegen.py) compiles symbolic blades through RationalPolynomial + poly_cse over exact sympy.Expr leaves—needing only simp_func=sp.cancel when dividing rational functions.
3. Takeaway for GEOMETOR¶
Use kingdon’s blade conventions (never galgebra’s >>) to expose lightweight 2D PGA and 2D CGA multivector projections over geometor.model elements—giving GEOMETOR division-free projective chains and 1-line conformal circle algebra while preserving Model’s explicit step lineage.