JuliaGeometry / JuliaGeometry/Rotations.jl
Treating antipodal quaternions as equal breaks some operations
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 188
- Forks
- 45
- PR merge metrics
- No merged PRs in 30d
Description
Currently, antipodal quaternions are treated as equal, i.e., q == -q. I can see the motivation for this -- they induce the same rotation -- but this leads to several issues:
-
AFAIK, accessing the quaternion components is part of the public API. So it's confusing that two
UnitQuaternions can be==but have different values of the field:q == -qbutq.w != (-q).w. -
The exponential map is broken: https://github.com/JuliaGeometry/Rotations.jl/issues/128
-
zero(UnitQuaternion)is not a valid unit quaternion. As described in https://github.com/JuliaGeometry/Rotations.jl/issues/30#issuecomment-662464903), there is an undocumented semantics of "unnormalized unit quaternion" which is used for some operations such as exp and log, but is not ultimately coherent. Better would be to have a separate type for infinitesimal unit quaternions, similar to what's being done in https://github.com/JuliaGeometry/Rotations.jl/issues/30. That type has a zero;UnitQuaternionshould not have a zero.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the UnitQuaternion equality, exponential and logarithm operations, and zero(UnitQuaternion), then read the linked issues about the exponential map and infinitesimal unit quaternions. Done means the quaternion equality semantics and zero-value behavior are coherent, with a separate type if needed for infinitesimal operations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- computer-graphics
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100