5 ms·
You can take the logarithm of a rotor in order to do interpolation. If you want a transformation represented by a rotor R to happen in N steps, you can apply R
by defen 8y ago
You can take the logarithm of a rotor in order to do interpolation. If you want a transformation represented by a rotor R to happen in N steps, you can apply R ^ (1/N) N times. The Nth root of R is exp(log(R)/N)
- BenFrantzDale 8y agoThe same is true (with lower performance, I suspect) with the 3x3 matrix representation.
- jacobolus 8y agoMatrices for rotation have the problem that you are using a 9-dimensional representation for a 3-dimensional quantity, so it is easy to make matrices that are not rotations (indeed the vast majority of the possible space of matrices consists of transformations that are not anywhere close to a pure rotation). Composing matrices leads to rounding errors. It is more complicated to invert matrices. As you say the matrix logarithm is more complicated. Etc. If you use a scalar + bivector “rotor” representation, that is only a 4-dimensional representation, which is easy to normalize to unit magnitude.
- jcagalawan 8y agoIsn’t the inversion a trivial transpose for rotations since they’re orthogonal?
- gugagore 8y agoIt's beautiful to see that the logarithm of a rotation matrix is a skew-symmetric matrix. The skew-symmetric matrices correspond to angular velocity, which behave like vectors. You can add and interpolate as you expect. Rotation matrices multiply. Skew-symmetric matrices add. The logarithmic and exponential map moves between the two spaces. Just letting you know that I think it's valuable to bring up matrices into this discussion, even if they do have problems in practice with rounding errors and efficiency.
- marctenbosch 8y agoSkew symmetric matrices are isomorphic to bivectors :)
- senderista 8y agoThat’s because skew-symmetric matrices are the Lie algebra of the Lie group of rotation matrices (and the exponential map takes a Lie algebra to a Lie group). In physics we call them the “infinitesimal generators” of the rotation group.
- gugagore 8y agoI love knowing about Lie algebras and groups, but I think I disagree about the "because". The matrix exponential and logarithm just are. You can define and compute them without invoking anything about Lie groups. I didn't know the term "infinitesimal generator". Thanks!
- BenFrantzDale 8y agoIndeed. And certainly since rotation matrices and quaternions are both representations of rotation, they should have a log that is isomorphic. Wilder still is the log of a 4x4 transformation matrix has the same tangent-vector properties, giving a coordinate-system-invariant rotation and translation.
- jacobolus 8y agoAnd if you don’t want to take the logarithm per se, you can bisect the rotation A by taking the sum of your rotor + 1, and then normalizing the result by dividing by the magnitude, (A + 1) / |A + 1|. Or if you have two rotors A and B, you can interpolate halfway between by taking (A + B) / |A + B|. This requires seven additions, four multiplications, one division, and one square root.
- raphlinus 8y agoI would replace the last two operations by another multiplication and one reciprocal square root. There is extensive SIMD support for very fast approximations, and getting better in newer chips.
- jacobolus 8y agoYes of course. I just mean, conceptually that is what is required. You can replace a bunch of the multiplications and additions by FMA instructions as well. By the way Raph, I think you might be interested in this draft paper I have been working on (well, not working on for the past two months, but anyway...) https://beta.observablehq.com/d/e639659056145e88 https://beta.observablehq.com/d/e639659056145e88
- raphlinus 8y agoVery cool! Some of the later sections are broken. The fact that this is interactive is great, maybe I'll get around to putting my stuff in this form.
- jacobolus 8y agoThe broken parts are intentionally commented out, either now redundant or not finished yet. (Observable isn’t the best for version control / etc. yet.) There are still a bunch of diagrams to make but I got a bit stalled on the project after going on a trip (and taking care of a toddler full time). There are still a couple of research problems to figure out. In particular how to best set the tangent and curvature at the knots. Just fitting circles through triples of points isn’t the best method. But I think this thing should compare favorably to Spiro curves for some use cases: in particular it is pretty local, a bit more robust to pathological inputs, and a lot simpler to compute (and explain). (But of course isn’t going to be globally optimizing for some smoothness metric, and isn’t extensional.) Edit: sorry to bystanders for a completely off-topic conversation.