Skip to content

Basis Classes

The pytanga.basis submodule provides eight Basis subclasses of Algebra that expose all named basis blades as attributes. Four are for 3D geometry and four for 2D. They are the recommended starting point for interactive work, scripts, and notebooks.

Among the 3D classes, BasisE3 covers Euclidean 3D, BasisP3 covers Projective 3D, BasisN3 covers conformal/null 3D using the null‑vector embedding, and BasisPGA3 implements the Gunn/Dorst plane‑based PGA.

Among the 2D classes, BasisE2 covers Euclidean 2D, BasisP2 covers Projective 2D with homogeneous coordinates, BasisN2 covers conformal/null 2D, and BasisPGA2 implements the Gunn/Dorst plane‑based PGA for 2D Euclidean geometry.

The Bases page also describes three patterns for accessing named blades: explicit assignment, attribute access, and namespace injection.

from pytanga.basis import BasisE2, BasisP2, BasisN2, BasisPGA2
from pytanga.basis import BasisE3, BasisP3, BasisN3, BasisPGA3

Reference

Topic Guide
All eight basis classes — BasisE2/P2/N2/PGA2 and BasisE3/P3/N3/PGA3 Bases
Null‑vector embedding — mathematical foundation for BasisN3, BasisPGA3, BasisN2, and BasisPGA2 Null‑Vector Embedding
Per‑class detail pages BasisE2, BasisP2, BasisN2, BasisPGA2

Quick start

from pytanga.basis import BasisE3

E3 = BasisE3()

# Named blades as attributes; multivectors from strings
v = E3("e1 + 2 e2 + 3 e3")
b = E3.e1 * E3.e2           # geometric product → e12

E3.show(v, "v")
print(b)                     # "e12"