is a quote from the article http://en.wikipedia.org/wiki/QuaternionHowever, quaternions have had a revival since the late 20th Century, primarily due to their utility in describing spatial rotations. The representations of rotations by quaternions are more compact and quicker to compute than the representations by matrices. In addition, unlike Euler angles they are not susceptible to gimbal lock. For this reason, quaternions are used in computer graphics,[10] computer vision, robotics, control theory, signal processing, attitude control, physics, bioinformatics, molecular dynamics, computer simulations, and orbital mechanics. For example, it is common for the attitude-control systems of spacecraft to be commanded in terms of quaternions
On the subject of Quaternions
Moderators: winston, another_commander, Cody
On the subject of Quaternions
I may not be the only one to wonder what are those mysterious Quaternions, and why they are in Oolite. I bet Ahruman could give a nice, compact and easy to understand answer - before that one could read a bit:
...and keep it under lightspeed!
Friendliest Meteor Police that side of Riedquat
Far Arm ships
Z-ships
Baakili Far Trader
Tin of SPAM
Friendliest Meteor Police that side of Riedquat
Far Arm ships
Z-ships
Baakili Far Trader
Tin of SPAM
- Selezen
- ---- E L I T E ----
- Posts: 2530
- Joined: Tue Mar 29, 2005 9:14 am
- Location: Tionisla
- Contact:
Re: On the subject of Quaternions
I tried reading that article back when I started trying to make OXPs. I tried again after reading this post.
I went crosseyed at the word "commutative". Again. Ironically, I use mathematics in my job, and I'm pretty sure quaternions would be useful. If I could only understand them...Wikipedia wrote:In mathematics, the quaternions are a number system that extends the complex numbers. They were first described by Irish mathematician Sir William Rowan Hamilton in 1843[1][2] and applied to mechanics in three-dimensional space. A feature of quaternions is that the product of two quaternions is noncommutative. Hamilton defined a quaternion as the quotient of two directed lines in a three-dimensional space[3] or equivalently as the quotient of two vectors.[4] Quaternions can also be represented as the sum of a scalar and a vector.
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
Re: On the subject of Quaternions
Answer in two sentences: quaternions are a mathematical way to precisely describe a rotation in three-dimensional space. And they are in Oolite because Oolite needs to rotate things in three-dimensional space.Zieman wrote:I may not be the only one to wonder what are those mysterious Quaternions, and why they are in Oolite.
Voilà.
- Gimbal Locke
- ---- E L I T E ----
- Posts: 293
- Joined: Sun Jan 08, 2012 11:32 pm
- Location: Brussels
- Contact:
Re: On the subject of Quaternions
While quaternions may not be susceptible to me, I find this resource most helpful: http://rosettacode.org/wiki/Quaternion_type , it shows how to define and compute with quaternions in 33 programming languages.Zieman wrote:is a quote from the article http://en.wikipedia.org/wiki/QuaternionIn addition, unlike Euler angles they are not susceptible to gimbal lock.
This video shows the problem: http://www.youtube.com/watch?v=rrUCBOlJdt4
This video shows the solution: http://www.youtube.com/watch?v=2XehAXAt0DE
Last edited by Gimbal Locke on Tue Mar 20, 2012 1:52 pm, edited 1 time in total.
- Mauiby de Fug
- ---- E L I T E ----
- Posts: 847
- Joined: Tue Sep 07, 2010 2:23 pm
Re: On the subject of Quaternions
Non-commutative simply means that the order of operations makes a difference. For example, 2 * 3 = 3 * 2 is commutative. It doesn't matter which comes first. With quaternions, i * j = k, but j * i = -k. You get a different result.
Funnily enough, I can understand/follow almost all of that page. I think the useful bit is
Funnily enough, I can understand/follow almost all of that page. I think the useful bit is
Wikipedia wrote:Conjugation by a unit quaternion (a quaternion of absolute value 1) with real part cos(θ) is a rotation by an angle 2θ, the axis of the rotation being the direction of the imaginary part.
- Fatleaf
- Intergalactic Spam Assassin
- Posts: 1988
- Joined: Tue Jun 08, 2010 5:11 am
- Location: In analysis mode on Phaelon
- Contact:
Re: On the subject of Quaternions
And for a handy tool for working them out I have acquired a !Nothing to see here! along the way. Help yourself
EDIT: This isn't the post you are looking for
EDIT: This isn't the post you are looking for
Last edited by Fatleaf on Mon Mar 26, 2012 11:59 am, edited 1 time in total.
Find out about the early influences of Fatleaf here. Also his OXP's!
Holds the Ooniversal record for "Thread Necromancy"
Holds the Ooniversal record for "Thread Necromancy"
- Gimbal Locke
- ---- E L I T E ----
- Posts: 293
- Joined: Sun Jan 08, 2012 11:32 pm
- Location: Brussels
- Contact:
Re: On the subject of Quaternions
Fatleaf, that links to a Windows executable. Do you have the source code for that or is it Windows-specific?Fatleaf wrote:And for a handy tool for working them out I have acquired a Quaternion Generator along the way. Help yourself
- Fatleaf
- Intergalactic Spam Assassin
- Posts: 1988
- Joined: Tue Jun 08, 2010 5:11 am
- Location: In analysis mode on Phaelon
- Contact:
Re: On the subject of Quaternions
That is a good questionGimbal Locke wrote:Fatleaf, that links to a Windows executable. Do you have the source code for that or is it Windows-specific?Fatleaf wrote:And for a handy tool for working them out I have acquired a Quaternion Generator along the way. Help yourself
It works on Win7. But I don't have the source code for it. Give it a go and see if it works for you!
Find out about the early influences of Fatleaf here. Also his OXP's!
Holds the Ooniversal record for "Thread Necromancy"
Holds the Ooniversal record for "Thread Necromancy"
Re: On the subject of Quaternions
Commutative : A*B = B*ASelezen wrote:I went crosseyed at the word "commutative". Again. Ironically, I use mathematics in my job, and I'm pretty sure quaternions would be useful. If I could only understand them...
Anti-Commutative : A*B = -B*A
Non-Commutative : A*B != B*A
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
- PhantorGorth
- ---- E L I T E ----
- Posts: 647
- Joined: Wed May 20, 2009 6:48 pm
- Location: Somewhere off the top left of Galaxy 1 map
Re: On the subject of Quaternions
This image shows why rotations are non-commutative:
90 degree rotations by the z then x axes gives a different outcome for 90 degree rotations by the x then z axes.
90 degree rotations by the z then x axes gives a different outcome for 90 degree rotations by the x then z axes.
Chat and relax with other commanders in the [url=irc://irc.oftc.net/oolite]DS's Seedy Space Bar[/url]. The Coolest Bar in the Eight.
Phantor's OXPs: GalCop Rewards and Safe Docking
Phantor's OXPs: GalCop Rewards and Safe Docking
Re: On the subject of Quaternions
just lit in my head . Thank you. (Not that I need it for anything important, but still interesting).
"A brilliant game of blasting and trading... Truly a mega-game... The game of a lifetime."
(Gold Medal Award, Zzap!64 May 1985).
(Gold Medal Award, Zzap!64 May 1985).
- SandJ
- ---- E L I T E ----
- Posts: 1048
- Joined: Fri Nov 26, 2010 9:08 pm
- Location: Help! I'm stranded down here on Earth!
Re: On the subject of Quaternions
Oh, I see! Because when you swivel the object around the vertical z axis, the sides move around but the two side-on axes x and y don't move with them.
So if you:
- turn the die over on the x or y axis, then spin it around on the z axis
that won't be the same as:
- spin it around on the z axis, then turn the die over on the x or y axis
because different sides of the die are now facing the x and y axes once the die has been spun.
I now recall an Open University TV programme from the 1980s about the huge machines the Royal Mail use to turn letters the same way up. It does 3 possible transformations:
a) the letters drop edge-on into a hopper which, when full, tips through 90 degrees and the letters carry on - used to move the stamps to the next edge along the envelope, i.e. between the y and z edges. (x axis rotation)
b) the letters pass between two belts which go through a 180 degree twist - used to get the stamps all one the same side. (y axis flip)
c) the letters stack up edge-on on a bunch and a human picks them up, turns round 180 degrees and puts them back in the machine further down the line, to get the stamps from back to front but leaving them at the top. (z axis flip)
Because the envelopes start off 'flat' in a pile, one axis need only ever need a 90 degree turn and so there are 8 possible arrangements of how the letters come into the sorting office (otherwise it would be 16). (Stamp top right, stamp top left, stamp bottom left, stamp bottom right ... x 2 for the stamp being at the back = 8 arrangements.)
They did all the horrid 3D maths and then said "But if you watch this machine, it will make sense". I remember the machine and its transformations very well; it was a huge monstrous piece of mechanised mathematical genius, but the maths fell out of my head long ago.
I did not know I had forgotten so much.
So if you:
- turn the die over on the x or y axis, then spin it around on the z axis
that won't be the same as:
- spin it around on the z axis, then turn the die over on the x or y axis
because different sides of the die are now facing the x and y axes once the die has been spun.
I now recall an Open University TV programme from the 1980s about the huge machines the Royal Mail use to turn letters the same way up. It does 3 possible transformations:
a) the letters drop edge-on into a hopper which, when full, tips through 90 degrees and the letters carry on - used to move the stamps to the next edge along the envelope, i.e. between the y and z edges. (x axis rotation)
b) the letters pass between two belts which go through a 180 degree twist - used to get the stamps all one the same side. (y axis flip)
c) the letters stack up edge-on on a bunch and a human picks them up, turns round 180 degrees and puts them back in the machine further down the line, to get the stamps from back to front but leaving them at the top. (z axis flip)
Because the envelopes start off 'flat' in a pile, one axis need only ever need a 90 degree turn and so there are 8 possible arrangements of how the letters come into the sorting office (otherwise it would be 16). (Stamp top right, stamp top left, stamp bottom left, stamp bottom right ... x 2 for the stamp being at the back = 8 arrangements.)
They did all the horrid 3D maths and then said "But if you watch this machine, it will make sense". I remember the machine and its transformations very well; it was a huge monstrous piece of mechanised mathematical genius, but the maths fell out of my head long ago.
I did not know I had forgotten so much.
Flying a Cobra Mk I Cobbie 3 with nothing but Explorers Club.OXP and a beam laser 4 proper lasers for company
Dropbox referral link 2GB of free space online + 500 Mb for the referral: good for securing work-in-progress.
Dropbox referral link 2GB of free space online + 500 Mb for the referral: good for securing work-in-progress.
- Staer9
- ---- E L I T E ----
- Posts: 570
- Joined: Fri Feb 18, 2011 4:53 pm
- Location: Hatfield, Hertfordshire (poor industrial)
Re: On the subject of Quaternions
I aquired (from a different source) the very same thing but was told that it is completely illegal to redistribute it in any way shape or indeed form, so you might want to remove it before said source returns to the BB and gets madFatleaf wrote:And for a handy tool for working them out I have acquired a Quaternion Generator along the way. Help yourself
unless of course you aquired permission, in which case I appologise
- Fatleaf
- Intergalactic Spam Assassin
- Posts: 1988
- Joined: Tue Jun 08, 2010 5:11 am
- Location: In analysis mode on Phaelon
- Contact:
Re: On the subject of Quaternions
Thanks for that. The sorce I got it from failed to state that it shouldn't be shared!Staer9 wrote:I aquired (from a different source) the very same thing but was told that it is completely illegal to redistribute it in any way shape or indeed form, so you might want to remove it before said source returns to the BB and gets madFatleaf wrote:And for a handy tool for working them out I have acquired a Quaternion Generator along the way. Help yourself
unless of course you aquired permission, in which case I appologise
Hey ho, it's gone now!
Find out about the early influences of Fatleaf here. Also his OXP's!
Holds the Ooniversal record for "Thread Necromancy"
Holds the Ooniversal record for "Thread Necromancy"