Conformal Geometric Algebra
Conformal geometric algebra (CGA) is an projective model of flats (points, lines, planes, ...) and rounds (point pairs, circle, spheres, ...) in $\mathbb{R}^n$ which represents objects as blades in a geometric algebra over $\mathbb{R}^{n + 2}$.
This package includes a small submodule which defines CGA and a few important operations, including standardform for classifying blades and the functions ipns and opns for obtaining the geometric forms represented by a blade.
You can obtain the standard basis blades for $n$-D CGA using the CGA{n} metric signature.
julia> using GeometricAlgebra.Conformaljulia> basis(CGA{3})5-element Vector{BasisBlade{GeometricAlgebra.Conformal.CGA{3}, 1, Int64}}: 1 v1 1 v2 1 v3 1 vp 1 vm
Notice that CGA includes two extra basis vectors: vp and vm squaring to $+1$ and $-1$, respectively. More generally, any metric signature Sig (defining the base space) has a conformalisation CGA{Sig} with two extra dimensions.
The representation of points in $\mathbb{R}^n$
In CGA, points $p \in \mathbb{R}^n$ are represented by null vectors (squaring to zero) in $\mathbb{R}^{n + 2}$ given by the map
\[\begin{align*} \operatorname{up} &: \mathbb{R}^n \to \mathbb{R}^{n + 2} \\ \operatorname{up}(p) &= n_0 + p + \frac12 p^2 n_\infty \end{align*}\]
where $n_0$ and $n_\infty$ are null basis vector satisfying $n_0^2 = n_\infty^2 = 0$ and $n_0 \cdot n_\infty = -1$. In terms of standard basis vectors, they are defined as n0 = (vm - vp)/2 and noo = vm + vp and can be obtained with nullbasis, origin and infinity.
julia> n0, noo = Conformal.nullbasis(3);Use the up function to lift $1$-vectors from a base space with signature Sig into CGA{Sig}:
julia> @basis 3[ Info: Defined basis blades v1, v2, v3, v12, v13, v23, v123, I in Mainjulia> p = v1 + 2v2 + 3v33-component Multivector{3, 1, SVector{3, Int64}}: 1 v1 2 v2 3 v3julia> up(p)5-component Multivector{GeometricAlgebra.Conformal.CGA{3}, 1, SVector{5, Float64}}: 1.0 v1 2.0 v2 3.0 v3 6.5 vp 7.5 vmjulia> ans == n0 + p + 2\p^2*noo # multivectors in Sig and CGA{Sig} are promotedtrue
The overall scale of vectors (and blades) in CGA does not matter; it is a homogeneous model. We can go the other way with the down map, dn.
julia> p == dn(up(p)) == dn(100up(p))true
You may notice that $n_0$ itself is equal to $\operatorname{up}(0)$ and $n_\infty$ is the limit of $\operatorname{up}(x)/\|x\|^2$ as $x$ goes to infinity in any direction. We interpret $n_0$ as the origin point and $n_∞$ as the unique point at infinity.[1]
Standard form of CGA blades
It is useful to represent blades in CGA{Sig} in purely terms of $n_0$, $n_∞$ and objects in the base space Sig.
In fact, any blade $X$ in CGA{Sig} is of exactly one of the four forms represented by the subtypes of CGABlade.
CGABlade Subtype | Mathematical form | $X \wedge n_\infty$ | $X \lfloor n_\infty$ |
|---|---|---|---|
DirectionBlade | $\bm{E} \wedge n_\infty$ | $=0$ | $=0$ |
FlatBlade | $\mathtt{T}_{\bm{p}}[n_0 \wedge \bm{E} \wedge n_\infty]$ | $=0$ | $\ne0$ |
DualFlatBlade | $\mathtt{T}_{\bm{p}}[\bm{E}]$ | $\ne0$ | $=0$ |
RoundBlade | $\mathtt{T}_{\bm{p}}[(n_0 \pm \textstyle{\frac 12} r^2 n_\infty) \wedge \bm{E}]$ | $\ne0$ | $\ne0$ |
Here, $\bm{E}$ is any blade in the base space, $\mathtt{T}_{\bm{p}}$ is the operator which translates by the base space vector $\bm{p}$ and $r$ is a scalar radius parameter.
The standardform method converts any blade in CGA{Sig} to one of these representations.
julia> standardform(v12 + 2v1∧noo)GeometricAlgebra.Conformal.DualFlatBlade{3, 2}: 2-blade of the form translate(p, E): E = 1.0 v12 p = 2.0 v2
This example shows how $𝐯_1𝐯_2 + 2𝐯_2∧n_∞$ can be written as $𝚃_{2𝐯_2}[𝐯_1𝐯_2]$.
Geometric objects represented by CGA blades
Any CGA blade $X$ can be associated with a subset of the base space $\mathbb{R}^n$ in two ways related by duality.[2]
Define the inner and outer product null spaces, obtained with ipns and opns:
\[\begin{align*} \operatorname{ipns}(X) &\coloneqq \{p \in \mathbb{R}^n \cup \{∞\} \mid \operatorname{up}(p) \mathop\rfloor X = 0 \} \\ \operatorname{opns}(X) &\coloneqq \{p \in \mathbb{R}^n \cup \{∞\} \mid \operatorname{up}(p) \wedge X = 0 \} \end{align*}\]
Possible values of $\operatorname{ipns}$ or $\operatorname{opns}$ are the following subsets of the extended base space $\mathbb{R}^n \cup \{∞\}$:
- the empty set,
- an affine $k$-plane (point, line, plane, and so on) which contains $∞$,
- a $k$-sphere (point, point pair, circle, sphere, and so on),
- the point at infinity.
Geometric objects of these kinds are represented by the FlatGeometry and RoundGeometry subtypes of CGAGeometry.
CGABlade Subtype | $\operatorname{ipns}$ | $\operatorname{opns}$ |
|---|---|---|
DirectionBlade | PointAtInfinity | PointAtInfinity |
FlatBlade | EmptySet | FlatGeometry |
DualFlatBlade | FlatGeometry | EmptySet |
RoundBlade | RoundGeometry | RoundGeometry |
For example, below we find that $\operatorname{opns}$ of the outer product of three conformal points is a circle with a centre, direction and real radius.
julia> p, q, r = up.(randn(Multivector{3,1}, 3));julia> opns(p∧q∧r)GeometricAlgebra.Conformal.RoundGeometry{3, 2}: 2-round (circle) around center p spanning E with square radius r2: p = -0.385454 v1 + -0.881723 v2 + -0.716738 v3 E = 0.595194 v12 + -0.240927 v13 + -0.484734 v23 r2 = 1.7190610700896372
- 1We are motivated by the fact that a unique point at infinity arises to consider an extended base space $\mathbb{R}^n \cup \{\infty\}$ rather than simply $\mathbb{R}^n$. Then we may define $\operatorname{up} : \mathbb{R}^n \cup \{\infty\} \to \mathbb{R}^{n + 2}$ with the additional rule $\operatorname{up}(\infty) = n_\infty$.
- 2They are dual in the sense that $\operatorname{ipns}(X) = \operatorname{opns}(I X)$ and $\operatorname{opns}(X) = \operatorname{ipns}(I X)$ where $I$ is the pseudoscalar.