Re:Geometric Algebra (2012)
by banachtarski on Monday November 30, 2020 @03:59AM
(#25251972)
It depends. For composing multiple transforms, composing versors aka quaternions/dual quaternions is cheaper than a full 4x4 multiply. For a single application, a 4x4 will be cheaper.
[ Parent
| on HN ]
Without benchmarks, I do not trust you. :) have you tried? On what platform? And did you take a look at the assembly code?
Take a look at Klein : https://www.jeremyong.com/klein/
(arm implementation is coming)
Its geometric product between motors is the equivalent of the 4x4 matrix product.
Although the basic computational complexity tells the story :
4x4 matrix product : 16 floats storage, 64 multiplies, 48 additions.
3D PGA versor product : 8 floats storage, 48 multiplies, 40 additions.
Re:Geometric Algebra (2012)
by banachtarski on Monday November 30, 2020 @05:49AM
(#25252505)
Quaternions are used in animation for blending and composing transforms for a reason. You don't have to trust me, but yes... tried for maybe ten years and counting from doing graphics and animation work.
From the documentation of the Eigen library [0]:
> If the quaternion is used to rotate several points (>1) then it is much more efficient to first convert it to a 3x3 Matrix. Comparison of the operation cost for n transformations:
> - Quaternion2: 30n
> - Via a Matrix3: 24 + 15n
So really it depends on what you're doing (admittedly here it is 3x3 not 4x4)
[0] https://eigen.tuxfamily.org/dox/classEigen_1_1QuaternionBase...
Re:Geometric Algebra (2012)
by banachtarski on Tuesday December 01, 2020 @04:50PM
(#25270438)
Right, as I said, composition is faster, not application.