4 ms·
I had a question about quaternions: does anyone use them for anything else than multiplying a rotation by a scalar? In particular, it feels a bit like a waste
by nraynaud 8y ago
I had a question about quaternions: does anyone use them for anything else than multiplying a rotation by a scalar?
In particular, it feels a bit like a waste of coding space to always use unit ones.
- colechristensen 8y agoSome control systems for air and space craft are designed with quaternions - here the problem being solved isn't a programming problem but a math problem involving the dynamics of the craft and/or orbital dynamics.
- nraynaud 8y agoAs far as I know they are also only doing SLERP for attitude control.
- colechristensen 8y agoI am not sure what you mean.
- nraynaud 8y agoAttitude control is not an example of using quaternions for something else than rotations.
- blt 8y agoThere does not exist a R^3 parameterization of the 3d rotations without some problem. https://en.m.wikipedia.org/wiki/Charts_on_SO(3)#Parametrizations https://en.m.wikipedia.org/wiki/Charts_on_SO(3)#Parametrizat...
- edflsafoiewq 8y agoBut quaternions are pretty good. They're a double cover but angles are an "infinity cover" of SO(2) and everyone understands angles. For animation purposes, being a single-cover is arguably a problem. An example in 2D is to suppose you have a rotation sequence 0° -> 90° -> 180° -> 270° -> X and you want to return to the original state. Well, you can do that either by continuing to rotate in the same direction, corresponding to X=360° or by going back along the path you came corresponding to X=0°. These alternatives are unrepresentable in a single cover. (For angles you also have X=-360°, 720°, etc. corresponding to making any number of revolutions in either direction before coming to rest at the desired target, which if you think is weird makes quaternions an even better chart on SO(3) than angles are on SO(2)).
- blt 8y agoI agree quaternions are a good parameterization of SO(3). But they can still cause unexpected problems, e.g. any machine learning task involving quaternions will be made harder because the learned function must deal with the double covering. Of course, the same problem exists for angles in SO(2), and from what I've seen people usually deal with that by using the [sin, cos] pair instead.
- macawfish 8y agoThe remarkable thing about quaternions is that you can describe rotation around any arbitrary axis! Try doing that with real rotation matrices and you will bump into a major problem: https://en.wikipedia.org/wiki/Gimbal_lock https://en.wikipedia.org/wiki/Gimbal_lock Because matrix multiplication is not commutative, you can't easily compose a matrix representing rotation around an arbitrary axis from "component rotation matrices". With quaternions/clifford algebras, you can say "here's the vector I want to rotate about and here's this is how much I want to rotate", and it just magically works.
- billfruit 8y agoI find that many articles explaining how to describe the orientation of a rigid body rotated along an axis by an angle in a confusing manner. Normally in 3d space you will have to construct quaternions for rotations along yaw, pitch and roll, and then take their product to get the quaternion of the orientation of the rigid body. That is, when using quaternions to describe orientations,we are actually describing the rotations done to bring the body from its default orientation to its present orientation.
- deleted 8y ago[deleted]
- twtw 8y ago> Normally in 3d space you will have to construct quaternions for rotations along yaw, pitch and roll, and then take their product to get the quaternion of the orientation of the rigid body Is this not just using Euler angles via quaternions? If I understand correctly, tracking rotation via yaw, pitch, and roll will still run into issues of gimbal lock because it's the same parameterization just using quaternions.
- civility 8y ago> The remarkable thing about quaternions is that you can describe rotation around any arbitrary axis! Try doing that with real rotation matrices and you will bump into a major problem https://en.wikipedia.org/wiki/Rotation_matrix#Rotation_matrix_from_axis_and_angle https://en.wikipedia.org/wiki/Rotation_matrix#Rotation_matri...
- 1wd 8y agoYou can also use the for making pretty pictures of Quaternion Julia fractals. It uses non-unit quaternions, but typically intersects a plane with the 4D solid: http://paulbourke.net/fractals/quatjulia/ http://paulbourke.net/fractals/quatjulia/ Apparently there's also an application in multiantenna radio transmission: http://www.ece.ualberta.ca/~hcdc/Library/StCommClass/Hugh00.pdf http://www.ece.ualberta.ca/~hcdc/Library/StCommClass/Hugh00....