4 ms·
Say what you want about geometric algebra, if it has a least one merit, it's that it makes rotations in 3D space and their link with quaternions very simple to
by grondilu 10y ago
Say what you want about geometric algebra, if it has a least one merit, it's that it makes rotations in 3D space and their link with quaternions very simple to understand.
Also check out my implementation in Perl 6:
https://github.com/grondilu/clifford https://github.com/grondilu/clifford
With it, quaternions become:
use Clifford;
constant I = @e[1]*@e[2];
constant J = @e[2]*@e[3];
constant K = @e[1]*@e[3];
say I² == J² == K² == I*J*K == -1;
- logfromblammo 10y agoThe subalgebra of 3D Clifford using the scalar and the 2-blades represents quaternions. The subalgebra using the pseudoscalar and the 1-blades can also represent quaternions. You have to be careful using other people's implementations, because certain operations are anticommutative, so sign conventions and operand ordering matters a lot more. For instance, choosing whether K is defined as e3 * e1 rather than e1 * e3 depends on whether your base vectors square to 1 or -1. Geometric Algebra is cool. It lets you say things like "the intersection of two spheres that don't touch is a circle with negative radius." You can't even represent a circle with negative radius in regular geometry.
- grondilu 10y ago> You have to be careful using other people's implementations, because certain operations are anticommutative, so sign conventions and operand ordering matters a lot more. For instance, choosing whether K is defined as e3 * e1 rather than e1 * e3 depends on whether your base vectors square to 1 or -1. Sure. For my implementation I thought a lot about how to deal with signatures and stuff. It's technically easy but making it simple and elegant is not obvious. I first thought about defining a @signature array, but then it occurred to me that it's much simpler to create two infinite spaces : one euclidean and one anti-euclidean. Later I've learned that Hestenes and others have considered this as well, they called it the mother of all geometric algebras, or universal geometric algebra[1]. Conveniently, Perl 6 deals with infinite lists very well, so it was very appropriate. So in my implementation, @e[$i]² is +1 for all $i. If you want vectors with negative squares, use the @ē basis. With geometric algebra, there are indeed several ways to represent quaternions. In fact there are several ways to represent complex numbers as well. I don't think it's a pitfall. As long as notations are clear and simple, it should be fine, I think. 1. https://en.wikipedia.org/wiki/Universal_geometric_algebra https://en.wikipedia.org/wiki/Universal_geometric_algebra
- logfromblammo 10y agoNo, not a pitfall. it is more like a small pothole in the road: the problem is easily avoided if you already know that it exists.
- stephencanon 10y ago> Geometric Algebra is cool. It lets you say things like "the intersection of two spheres that don't touch is a circle with negative radius." You can't even represent a circle with negative radius in regular geometry. For some notion of "regular geometry". Desargues could produce this result in the early 17th century by lifting the circles into right cones in three dimensions, though he would probably tell you that the circle with negative radius was meaningless.
- jacobolus 10y agoYou might like http://geocalc.clas.asu.edu/pdf/PGwithCA.pdf http://geocalc.clas.asu.edu/pdf/PGwithCA.pdf
- riboflava 10y agoI was going to ask how your implementation compares to Versor[0] but I see you link from it in your readme. My next question was going to be if there are any license issues, since Versor was for a long time only free for non-commercial use, but I see their github is a bit more recently updated than their home page and mentions it's now under the BSD (yay!). Lastly, are you concerned about the patent on the conformal method? [1] There are a lot of great resources linked in this thread. My memory of the last time I took a dive into GA was that there was a split in the resources for representation -- one side tried to do everything axiomatically and symbolically, the other side had some concrete numbers but it was mysterious how they all worked together. Have you seen a super-basic resource that goes through the same sorts of modeling problems middle school and high school students do when first learning trig and classic geometry? [0] http://versor.mat.ucsb.edu/ http://versor.mat.ucsb.edu/ [1] https://www.google.com/patents/US6853964 https://www.google.com/patents/US6853964
- grondilu 10y ago> Lastly, are you concerned about the patent on the conformal method? I did not know it was patented. My module does not specifically implement the conformal method, though. I did create two nul vectors and I called them no and ni, as in the conformal method, but that's about it. It's very much possible to do conformal geometric algebra with my module, but it's just not nearly as optimized as Versor is. I've tried many times to implement Versor in Perl 6, but for various reasons I never succeeded. It's just kind of hard I guess. Also I'm not completely sure the optimization method I implemented is much worse, so it's hard for me to convince myself into doing the effort to improve it. Also, I'm slightly skeptical the method used by Versor is the best that can be done, so again that dissuades me to do the effort. I would love to see it done, though.