Skip to content

Commit d442dc8

Browse files
Merge pull request #95 from chakravala/patch-1
elaborated on Grassmann.jl quaternions. It is not perfect, but still better than what was. Also, it is great to have the perspective of the main developer.
2 parents 5ed1f49 + 6ef6560 commit d442dc8

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

docs/comparisons/math/quaternions.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,27 @@ There was an [issue#25](https://github.com/JuliaSpace/ReferenceFrameRotations.jl
6161
{{badge Grassmann}}
6262
[Grassmann.jl](https://github.com/chakravala/Grassmann.jl) does not implement `Quaternion` as a struct, but quaternions are realized as an alias `Grassmann.Quaternion (alias for Spinor{V, T, 4} where {V, T})`.
6363

64+
Comparison of quaternions in the context of `Grassmann` to other quaternion implementations is characterized by syntax design differences to fit into a larger mathematical formalism.
65+
Differences such as performance or edge cases can always be smoothed out, while syntax and design choices are fundamentally different.
66+
With `Grassmann` geometric algebra it is possible to achieve much more out of quaternions due to the immediate access to its fully general mathematical formalism.
67+
68+
Quaternion algebra exists as a specialized sub-algebra within a more general `Grassmann` geometric algebra, where the goal is to seamlessly transition between quaternion abstractions and further combinatorial generalizations.
69+
There are several ways to assign `i,j,k` with `Grassmann` elements, perhaps the standard would be `i = v12`, `j = -v13`, `k = v23` (although this is not a unique choice).
70+
Since `j` and `v13` have opposite sign in this notation, the `quatvalues` method is exported to output the coefficients with the sign convention of `s,i,j,k`.
71+
* assign `Grassmann` elements for quaternion usage: `using Grassmann; basis"3"`
72+
* basis: `v, v₁, v₂, v₃, v₁₂, v₁₃, v₂₃, v₁₂₃` or `v, v1, v2, v3, v12, v13, v23, v123`
73+
* assign quaternion basis: `s, i, j, k = v, v12, -v13, v23` could be a standard choice
74+
* `quatvalues(::Quaternion)` returns the coefficient values according to `s, i, j, k`
75+
* `quaternion(s,i,j,k)` returns the `Grassmann` quaternion from the `s, i, j, k` standard
76+
77+
As a result of the framework of geometric algebra implemented in `Grassmann`, vector algebra and quaternion algebra are compatible in a unified formalism.
78+
Given a quaternion operator `R` and a vector `x` the operator can be applied with either the `R>>>x` (evaluated as `R*x*conj(R)` operator) or `x⊘R` (evaluated as `conj(R)*x*R` operator) to transform vectors with quaternions.
79+
Converting a quaternion operator `R` on a three dimensional vector to a matrix (with the `x⊘R` evaluation) can be done with `Matrix(operator(R))` for convenience.
80+
81+
In the traditional quaternion packages there is only access to a limited mathematical scope constrained to rotations in three dimensions, while in `Grassmann` there are rotational algebras for lower and higher dimensions and it is also natural to deal with reflection operator compositions and more.
82+
This developer (for example), will feel a loss of mathematical expressibility when downgrading from `Grassmann` to a more limited quaternion formalism, as `Grassmann` can express the full graded algebra structure compared to the mere sub-algebra of quaternions.
83+
Programming using a more general and sophisticated mathematical formalism typically involves a more abstract and verbose syntax, and this is the case for Grassman.jl as compared to Quaternions.jl
84+
6485
## Related discourse posts
6586
* [Taking Quaternions Seriously](https://discourse.julialang.org/t/taking-quaternions-seriously/44834)
6687
* [[ANN] Quaternions.jl v0.7.0](https://discourse.julialang.org/t/ann-quaternions-jl-v0-7-0/91368)

0 commit comments

Comments
 (0)