BasisE2 — Euclidean 2D¶
BasisE2 provides the Euclidean 2D geometric algebra \(G(2, 0)\) with named
blade attributes. It is the simplest tangent-space algebra, supporting
vectors, bivectors, and rotors in the plane.
Algebra Properties¶
| Property | Value |
|---|---|
| Algebra | \(G(2, 0)\) |
| Dimension | 2 |
| Signature | 0 (all positive) |
| Num blades | \(2^2 = 4\) |
Named Blades¶
| Attribute | Blade | Bitmask |
|---|---|---|
e1 |
\(e_1\) | 0b01 |
e2 |
\(e_2\) | 0b10 |
e12 |
\(e_1 \wedge e_2\) | 0b11 |
I |
Pseudoscalar (\(e_1 \wedge e_2\)) | 0b11 |
Constructing Multivectors¶
Vectors are built from strings; rotors are created through the
geometry submodule:
v = E2("3 e1 + 4 e2") # 3·e1 + 4·e2
# Rotor: rotation by angle θ in the e12 plane (the only rotation plane in 2D)
from pytanga.geometry import Direction, Rotor, create_operator
r = create_operator(E2, Rotor(angle=1.57, axis=Direction(0, 0, 1))) # 90° CCW
Display¶
Example: Vectors and Rotors¶
from pytanga.basis import BasisE2
import math
E2 = BasisE2()
# Create vectors
a = E2("e1")
b = E2("e2")
# Geometric product
ab = a * b
E2.show(ab, "a*b") # e12 (bivector)
# Rotor: rotate a by 90° CCW
from pytanga.geometry import Direction, Rotor, create_operator
R = create_operator(E2, Rotor(angle=math.pi / 2, axis=Direction(0, 0, 1)))
a_rotated = R * a * ~R
E2.show(a_rotated, "R·a·R⁻¹") # -e2 (e₁ → -e₂ clockwise by default convention)
E2 has no points
E2 can only represent directions (vectors) and rotors. To work with points, use BasisP2 (projective) or BasisN2 (conformal).
Three Patterns for Accessing Blades¶
The same three patterns described in Bases
apply to BasisE2:
Pattern 1 — Explicit assignment (recommended)
Pattern 2 — Attribute access
Pattern 3 — Namespace injection