In (very much) earlier articles, I described:
- using complex numbers for rotating, translating, and scaling the plane
- using Clifford algebras for rotating, translating, and scaling the plane, and
- using quaternions for rotating, translating, and scaling three-dimensional space.
Today, it is time to tackle rotating, translating, and scaling three-dimensional space using Clifford algebras.
Three dimensions now instead of two
Back when we used Clifford algebras to rotate, translate, and scale the plane, we were using the two-dimesional Clifford algebra. With the two-dimensional Clifford algebra, we represented two-dimensional coordinates as . It shouldn’t surprise you then to find we’re going to represent three-dimensional coordinates as .
As before, we will have and . Similarly, we will have . In the two-dimesional case, we showed that . By the same logic as the two-dimensional case, we also find that and . We could potentially also end up multiplying , , and all together. This isn’t going to be equal to any combination of the other things we’ve seen so we’ll just leave it written .
Using the identities like for , we can shuffle any combination of , , and so that all of the indexes are in order. We may have to change the sign, but we won’t have to change anything else. For example:
Recall that was a
bivector. Here, we have added one more vector: , two more bivectors: and , and a trivector . The general element of the three-dimensional Clifford algebra looks like:
For the two-dimensional Clifford algebra, we had terms in the general element—the Clifford algebra is an algebra on a four-dimensional vector space. For the three-dimensional Clifford algebra, we have terms in the general element. If we backtrack here to the one-dimensional Clifford algebra, we see that the general element looks like meaning there are terms in the general element of the one-dimensional Clifford algebra. If we backtrack even further, we see that for a zero-dimensional Clifford algebra, the general element looks like meaning there is term in the general element of the zero-dimensional Clifford algebra.
This relation is going to hold for Clifford algebras in general. If is a non-negative integer, then there are terms in the general element of the -dimensional Clifford algebra. The -dimensional Clifford algebra is an algebra over a -dimensional vector space. There are degrees of freedom, if you like. We won’t be using all of those degrees of freedom because we are restricting ourselves to scaling, rotating, and translating vectors.
Translating and Scaling
We are going to represent our points in three-dimensional space using the vector portion of our three-dimensional Clifford algebra . So, a point with coordinates will be .
Just as we did in the two-dimensional case, we can scale three-space away from the origin by a factor of just by multiplying each point by the real number . So, .
Similarly, we can translate the point by units in the x-direction, units in the y-direction and units in the z-direction by creating a translation vector and adding it to each point so that .
When we used Clifford algebras to rotate the xy-plane, we let and let . Then, to rotate a point we multiplied out .
Three-dimensional space contains the xy-plane. We want to be able to rotate things in the xy-plane in just the same way we did in the two-dimensional case. We even spent some time in another article verifying that these rotations in the xy-plane would leave coordinates on other axises alone.
Rotating space with the quaternions, we found that could rotate around an arbitrary axis. If we pick an axis that points from the origin to where , then we used the quaternion (where and just like we used the two-dimensional Clifford algebra rotation. We let and . Then, we could rotate a point by evaluating .
With Clifford algebras, we don’t mush together translations and rotations both into the vector portion. We keep translations in the vector portion, but we move rotations to the bivector portion. We’re going to rotate around the axis from the origin to (where by an angle by letting
and where and . Then, we can rotate a point just by multiplying on the left by and on the right by so that .
I wrote a little differently here than I did above for the general element. If I were to keep totally consistent with what I wrote above, I should write . Certainly, we can add in any order, so it is totally cosmetic to write it one way or the other. I chose to keep , , and in order rather than , , and . I also chose to keep them all positive at the expense of using instead of .
Before we get into why we used instead of for the , let’s look at the case of rotating around the z-axis. In that case, would be . This should degenerate to exactly what we had for rotating the xy-plane with Clifford algebras. Sure enough, if we plop those values in for , , and we find that exactly as we had in the two-dimensional case. Bonus!
Why should the end up with instead of ? The way that our axis system worked with the quaternions is that we had the x-axis going east, the y-axis going north, and the z-axis going up. If we are going to rotate around the y-axis, then we need to rotate the z-axis toward the x-axis as opposed to rotating the x-axis toward the z-axis. The rotation around the z-axis takes the x-axis toward the y-axis. This is represented with the . is the x-axis and it is moving toward the y-axis . If we reverse the order, , then we are moving the y-axis toward the x-axis. Using our transposing tricks, . Thus, rotating the y-axis toward the x-axis is just negatively rotating the x-axis toward the y-axis. In better English, that is: rotating the y-axis toward the x-axis is just rotating the x-axis away from the y-axis.
If we had chosen instead of , then we would have messed up how our axises fit together. To keep the axis of rotation obvious, we used . We can still rewrite the result in any form we like. If we were given , that would be a rotation around the axis from the origin to the point . I think it’s more intuitive to write as because then you can read the axis of rotation right off of the coefficients.
Next time, we’ll tackle rotating, scaling, and translating hyperspace (four-dimensional space).