Started by Apr 22 2014 02:38 AM

,
9 replies to this topic

Posted 22 April 2014 - 02:38 AM

If you see a quaternion of a certain value, can you quickly determine how this
orientation would look on top of your head?
If you can, how can you do that handily?
Thanks
Jack

Posted 22 April 2014 - 06:04 AM

I recognise a few specific quaternion values (90 degree rotations in various axis, etc), but I couldn't tell you what direction an arbitrary-value quaternion is facing.

I'm sure some people can, but it's beyond me

Tristam MacDonald - Software Engineer @ Amazon - [swiftcoding] [GitHub]

Posted 22 April 2014 - 06:21 AM

Quaternions.

All I can say is thank God for Quaternion.eulerAngles (With unity anyway)

Posted 22 April 2014 - 06:48 AM

POPULAR

If you take a general quaternion like 0.6 + 0.3*i + 0.2*j - 0.71*k you may first look at the real part and observe this should be equal to cos(alpha/2) for some angle alpha. 0.6 is greater than 0.5 which is the cosine of 60 degrees, but less then sqrt(2)/2 ~= 0.71 which is the cosine of 45 degrees. It should then be something in between, let's say 52.5 which is in the middle (the correct angle is 53.13 degrees) and thus we have a rotation of approximately 105 degrees around the axis defined by its imaginary part. This is basically how you can get a rough idea of what a quaternion does.

Posted 22 April 2014 - 07:16 AM

around the axis defined by its imaginary part

Which is equally cumbersome to get, since you have to divide first by the sin of half the angle you got... I seriously recommend having a little mobile app to convert from quaternions to euler or something... for example: https://play.google.com/store/apps/details?id=quaternion.angel

“We should forget about small efficiencies, say about 97% of the time; premature optimization is the root of all evil” - Donald E. Knuth, Structured Programming with go to Statements

"First you learn the value of abstraction, then you learn the cost of abstraction, then you're ready to engineer" - Ken Beck, Twitter

Posted 22 April 2014 - 07:20 AM

around the axis defined by its imaginary part

Which is equally cumbersome to get, since you have to divide first by the sin of half the angle you got... I seriously recommend having a little mobile app to convert from quaternions to euler or something... for example: https://play.google.com/store/apps/details?id=quaternion.angel

Unless you brain can only work with unit-length vectors, you don't need to divide by anything.

Posted 22 April 2014 - 07:24 AM

As you explained, we can determine the angles of rotation around an

imaginary axis by looking at the real part of the quaternion,

can we also easily work out the axis in the imagainary part?

Thanks

Jack

Posted 22 April 2014 - 07:27 AM

Ha ha, I don't understand why humans, like me, always like to run circles around things.

Thanks everybody for participation in this discussion.

Sometimes I really want to work out quaternions quickly without relying on calculators,

this makes things way quicker

Thanks

Jack

Posted 22 April 2014 - 07:36 AM

An axis can be defined by any non-zero vector, not just the unitary ones. You do not need to convert the imaginary part at all.. I can clearly take that imaginary part and normalize it if I need/want, but it isn't necessary to do so. If I look at my original example I can say that the axis is in the X>0,Y>0,Z<0 octant and that the greater component is along the z-axis. This component is indeed more than twice the x-component and more than three times the y-component. I would probably draw this axis using the vector (3,2,-7.1).

Posted 22 April 2014 - 08:41 AM

around the axis defined by its imaginary part

Which is equally cumbersome to get, since you have to divide first by the sin of half the angle you got... I seriously recommend having a little mobile app to convert from quaternions to euler or something... for example: https://play.google.com/store/apps/details?id=quaternion.angel

Unless you brain can only work with unit-length vectors, you don't need to divide by anything.

That's pretty much my case, but I see your point My mistake.

“We should forget about small efficiencies, say about 97% of the time; premature optimization is the root of all evil” - Donald E. Knuth, Structured Programming with go to Statements

"First you learn the value of abstraction, then you learn the cost of abstraction, then you're ready to engineer" - Ken Beck, Twitter