Quaternions make my ears bleed. They're a means of measuring rotation that uses four elements. The advantage is you can avoid gimble lock you can get in euler rotation (X,Y,Z). http://www.youtube.com/watch?v=rrUCBOlJdt4
I've done some scripting in LSL for SecondLife and their rotation system is in quaternions. When I have to deal with rotations I just do it in euler and convert it when I'm done. Ugly, but I can usually get the result I want.
I read a tutorial on quaternions once. I was almost comprehending it and suddenly someone hit the warp drive and I was left in the dust. At the end of the tutorial was a note saying unless you've taken a course in higher math you have no shot at understanding this. I wish they had put that note at the front!
Not that I have the smarts/knowledge/desire to take this on. Just saying I know what that Q word means and it makes my brain hurt.
There are two "intuitive" perspectives on quaternions: a "computational" one that, if you're a math geek, will highlight how the quaternion computations are synonymous with algebraic transformational math, and a "geometric" one that will highlight what quaternion computations actually do. The former presumes significant knowledge in higher math, particularly linear algebra (i.e. matrix math). The latter doesn't require that. In fact, there's actually a kid-friendly way to explain quaternions, which I'll get to in three paragraphs.
What quaternions "do" is take the following perspective on rotational transformations. Imagine an object with a head and a tail and imagine rotating that object about all three axis but in such a way that the tail of the object is still at the origin. Even though you applied three different rotations (about x, y, and z) in fact the combination of those three rotations could be summarized by looking at where the head of the object ended up. Imagine drawing a line from the origin - where the tail is - to the head. That vector represents one part of the net rotation, describing the final direction the object is pointing. If you then rotate the object around that vector, like holding the tail and the head in each hand and then spinning the object, you can get to whatever orientation the object is in. In other words, one vector (direction) and one additional number (rotation) can describe any net amount of rotation. That's basically what quaternion representation does**.
To add two rotations, in geometric terms what you're doing is thinking about those rotations as "point, then spin." Do that twice, once for each rotation, and you end up with the net total rotation. The math to combine two quaternions is multiplication, not addition, but that's the basic principle.
One interesting thing about quaternions is that if you think about the perspective they encapsulate - point, and spin - there is only one unambiguous way to represent any set of 3D rotations. With Euler rotations about x, y, and z, there are generally multiple ways to specify the orientation of an object, because there are multiple ways to rotate an object about all three axis in a way that ends up in a certain orientation. And the reason it doesn't suffer the gimbal lock problem is obviously because this perspective only dictates two "rotations," an orientation direction and then rotation about that direction. Neither one alters gimbal axis.
And now the kid-friendly version. Basically, a quaternion is: point in any direction with your open hand, and then bank your fingers left or right. All rotations can be described by math that basically does that: point and bank. Multiplying quaternions works to add rotations because of the fact that "coincidentally" (not a coincidence, but you can think of it as such if you're not a math major) the math to multiply complex numbers just happens to be identical in formulas to the trig formulas to convert rotations into complex numbers. And quaternion math works better than Euler rotations for the simple reason that Euler rotations don't offer a unique way to represent a rotation in space. Quaternions do (there's only one way to point in a direction and then bank your fingers: no other point and bank ends up in the same orientation). That makes the math more efficient, eliminates gimbal lock, and solves lots of other problems involving rotational interpolation (what does it mean to go "halfway" from zero to a final rotation is easy: swing your arm half-way to the final pointing direction, and bank your fingers half-way, and you're done: every kid knows how to do this when they pretend their hand is an airplane and they fly it around the kitchen).
Anyway, that's how I remember quaternion math. Although I learned it via linear algebra, and had to come up with the flying-hand version myself a couple years later.
** Technically, quaternion representation uses a unit vector (whose length is one unit) and an additional number that is the length of the vector, to represent the rotation about the axis. So you can think of it as a pointing direction and a rotation about that axis, or you can also think of it as a four-dimensional vector whose magnitude is equal to the magnitude of rotation. The former is a little easier to visualize than the latter, although the latter is better to think about when you get down to the whats and whys of quaternion arithmetic - the mathy part.