Spring phisic and quaternion

Started by
12 comments, last by brebarth221 4 years, 2 months ago

Yes, it's “log” for “logarithm”: https://en.wikipedia.org/wiki/Quaternion#Exponential,_logarithm,_and_power_functions

It's been too long since I wrote this code, so I don't have all the details in my head, but the logarithm of a quaternion gives you the angular velocity you would have to integrate for one unit of time to get to that rotation (or something very close to that; I might be off by a factor of 2), so it's a good way to measure how far off from not rotating you are, and in which direction.

Advertisement

Ok. thanks.

alvaro said:
logarithm of a quaternion gives you the angular velocity

Wow! log of quaternion is related to torque.. amazing. Yet again a thing I was completely unaware of. Thanks!

brebarth221 said:

Ok. thanks.

alvaro said:
logarithm of a quaternion gives you the angular velocity

Wow! log of quaternion is related to torque.. amazing. Yet again a thing I was completely unaware of. Thanks!

If it helps, this is much easier to understand in the parallel case of 2D rotation being represented by a mudulus-1 complex number. If you identify points on the plane with complex numbers, a rotation by an angle alpha can be computed by multiplying by z = cos(alpha)+i*sin(alpha) == exp(i*alpha).

exp(k) can be thought of as, where would I end up if I start at 1 and then for one unit of time I move with velocity that is computed by multiplying my current position by k. When k is i*alpha, you are moving in a direction perpendicular to your current position, which makes you rotate, and alpha determines how quickly you rotate.

If you want to recover the angle from the complex number, you can do it by using log(z), which gives you i*alpha. In 3D, you get coefficients for i, j and k, telling you in which direction to rotate.

Thanks.. It will take time to understand.. But I will try.

This is helpful for me to begin to understand there is a relationship between rotation and exp():

cos(alpha)+i*sin(alpha) == exp(i*alpha)

This topic is closed to new replies.

Advertisement