JuliaGeometry / Rotations.jl

Julia implementations for different rotation parameterizations
https://juliageometry.github.io/Rotations.jl
MIT License
180 stars 44 forks source link

Add `QuatQuatRotation <: Rotation{4}` #249

Open hyrodium opened 1 year ago

hyrodium commented 1 year ago

I don't think the name QuatQuatRotation is appropriate, but I would like to add a new 4D rotation struct with two quaternions. (SO(4) is doubly covered by SU(2) × SU(2))

brainandforce commented 4 months ago

You might be interested in what CliffordNumbers.jl can do here. Rotations in N dimensions can be described with rotors in a geometric algebra, and those are representable with an EvenCliffordNumber{VGA(N)}. These can even be constructed from a KVector{2,VGA(N)} (a bivector representing the plane of a rotation) through exponentiation - the angle is encoded in the bivector scale.

When N === 2, the resulting type is isomorphic to complex numbers, and when N === 3 the type is isomorphic to quaternions. However, it doesn't follow a Cayley-Dickinson construction beyond that, so the N === 4 case is not isomorphic to octonions.

The implementation is a little different from Complex or Quaternion (for instance, the behavior of ' does not match conj) and my package is pretty new, so I understand if you're reluctant to add it as a dependency. But I figure a rotor-based rotation implementation for arbitrary dimensions may be of interest, and I'd like for the packages to be interoperable in the future!