Maths - Forum discussion with nhughes

By: nhughes (nhughes) - 2007-04-12 18:27
I replied to, I think, Martinbaker with the following. I am new to sourceforge and thought I was posting an open message. Anyway, here it is: 
Prospero and Martinbaker, nobody, etc. 
I have read your discussions of attitude, Euler angles and quaternions. I have been in the aerospace industry, in space launch and orbiting vehicles, for going on 30 years, 20+ of that using quaternion pretty much exclusively with a few unfortunate detours into Euler angles. Here are a few comments on your discussion:  
1) There is no "global reference" coordinate frame. The closest to this is ECI - Earth Centered Inertial. In the space craft world, this frame has the Z axis along the Earth rotation axis, the X axis along the Vernal equinox - the line of equinox's the intersection of the Earth equatorial plane and the plane of the Earth orbit ecliptic. Strictly speaking, even this frame is not inertially fixed, since the Earth's rotation axis precesses in a circle of, I think, 26(?) degrees diameter over a period of several tens of thousands of years. That having been said, there is an infinite number of coordinate frames; coordinate frame confusion is an on going problem. ECEF - Earth Centered, Earth Fixed has the z axis aligned with ECI but the X axis goes through the Prime Meridian, thus this frame rotates with the Earth. The Missile Defense Agency defines ECI as aligned with ECEF at a particular time and inertially fixed thereafter. Every piece of aerospace hardware will have a coordinate frame attached to it; ALWAYS KNOW WHAT COORDINATE FRAME(S) YOU ARE WORKING IN.  
2) There are 12 (actually 24, but who's counting?) different Euler rotation sequences - 3-2-1 (yaw, pitch, roll), 1-2-3 (roll, pitch, yaw), 1-3-1 (roll, yaw, roll), etc. Any sequence of the three rotation axes where you don't have the same axis twice in a row (which would just be a single rotation). There is no universal convention as to what sequence to use. In the literature, authors will say a particular order is the standard but few of them agree. If you have the misfortune to have to use Euler angles, KNOW WHICH ROTATION SEQUENCE IS IN USE. Euler angles suffer from singularities - the dreaded "gimbal lock" of Apollo 13 fame - and equations of motion that are almost impossibly complex.  
3) I have developed a universal algorithm that converts a quaternion to any specified Euler rotation sequence, using geometric, rather than algebraic, methods. Please contact me if you would like details.  
4) Quaternions are the, by far, preferred method of describing and analyzing attitude and rotations. Quaternions can be used to propagate attitude, perform vector transformations and rotations. These operations can be performed without having to derive rotation matrices or Euler angles. Quaternions do not have singularities; equations of motion using quaternions are almost trivial in their simplicity.  
Let me know if I can be of any help.  

By: Martin Baker (martinbakerProject Admin) - 2007-04-13 02:00
Hello nhughes, 
Thanks very much for your replies, yes this is an open forum, I think others will find them interesting as I do. 
RE: "global reference" coordinate frame: 
Would it be all right with you if I copied this information to the associated web pages as I think I will be useful to the readers of these pages also? Of course I will include your name as author. 
Is it possible to define a coordinate system independent of earth? Say based on background star map? That would give directions but we would still need an origin, say the centre of the sun? I guess spacecraft that leave earth orbit must need some wider coordinate system? 
The term "global reference" seems useful in a more abstract way to indicate the most general coordinate system in a given situation? 
RE: different Euler rotation sequences 
Yes I would be very interested in universal algorithm that converts a quaternion to any specified Euler rotation sequence to add to this page: 
Do you consider singularities and "gimbal lock" as different or as different manifestations of the same effect? It seems to me that they both arise from the position where two of the axies coincide and therefore we loose one degree of freedom? I would like to define them more precisely on the web pages. 

By: nhughes (nhughes) - 2007-04-13 21:21
Yes, singularities and gimbal lock both arise, exactly as you say, from two of the rotation axes becoming aligned and thereby degenerating into a single degree of freedom; gimbal lock is just the manifestation of a mechanical device analogous to the mathematical singularity. 
Yes, you can define any coordinate frame you like, relative to stars, the Sun, any planet, a car's driver, your dog's food bowl. Most coordinate frames are right handed (x crossed into y yields z) and orthogonal (all axes are 90 degrees from the other two), but your frame doesn't have to adhere to these rules - it's your coordinate frame. About the only rule is that no two axes can be colinear. Then there are non-cartesian (x-y-z) coordinate systems - spherical, cylindrical, coordinate systems whose axes are functions and, thereby, not straight lines. Whew! It exhausts me to think about all this! 
The algorithm to convert a quaternion into Euler angles goes something like this: (I deleted the description after looking at your website and seeing that you copyright the material) 
I have not found this algorithm anywhere else in the literature or on the web or any other universal algorithm. 
I'm curious, what prompts your interest in quaternions? Aerospace? Animation? Something else?  
I went to the website you reference and see that you have it copyrighted. If you will provide me with the process for copyrighting material, I will share the algorithm (after I copyright it). If I can put together a binary executable that implements the algorithm (and, therefore, doesn't provide the algorithm) I will forward it. 
Noel Hughes

By: nhughes (nhughes) - 2007-04-13 21:40
OOOps! My earlier post about the movement of the ECI coordinate frame was wrong. The obliquity - the angle between the equatorial and ecliptic planes - remains approximately constant ~23 1/2 degrees, but the Earth rotation axis, and thus, the line of equinoxes, rotates around the normal to the ecliptic through 360 degrees every, roughly, 26000 years - about 50 arc seconds per year. (I knew 26 was in there somewhere). For high accuracy attitude work, you have to specify the epoch (the time) of the ECI coordinate frame you're using. There are several standard , 1950, 1984 and 1/01/2000. 
Noel Hughes

By: Martin Baker (martinbakerProject Admin) - 2007-04-14 00:21
I know very little about legal matters so don't rely on my opinion! As far as I know copyright (unlike patent) is not registered with anyone, see this Wikipedia entry: 
Under the Berne Convention, copyrights for creative works do not have to be asserted or declared, as they are automatically in force at creation: an author need not "register" or "apply for" a copyright in countries adhering to the Berne Convention. As soon as a work is "fixed", that is, written or recorded on some physical medium, its author is automatically entitled to all copyrights in the work, and to any derivative works unless and until the author explicitly disclaims them, or until the copyright expires. The Berne Convention also resulted in foreign authors being treated equivalently to domestic authors, in any country signed onto the Convention. The UK signed the Berne Convention in 1887 but did not implement large parts of it until 100 years later with the passage of the Copyright, Designs and Patents Act of 1988. The USA did not sign the Berne Convention until 1989. 
end of Wikipedia quote. 
I'm not sure if this applies to algorithms? If you want to protect an algorithm you may need a patent, I really don't know? 
It would be nice to have the website available under an open licence (all my programs are available under the GPL) but that would potentially cause lots of problems. For instance the search engines penalise duplicated content so it would be harder to find. 
Also the adverts give some income, not much! but enough to pay the hosting costs. 
Anyway, its upto you, if you are not comfortable with putting it on the web its probably best not to. 
If you would like to put it on the website I can include any copyright notice you suggest. 
Also, as a separate issue, are you OK with the contents of these messages (i.e. the discussion of coordinate systems) being copied to the website? As this is very interesting. 

By: nhughes (nhughes) - 2007-04-14 08:47
Yes, feel free to put anything in these emails on your website as it's all in the open literature. Also, feel free to edit out any salty comments I may make; after my years in the industry I am probably a little too cynical about some topics. Again, I would appreciate my name attached to the material and a notice, perhaps by link, that I am available for consulting. 
Again, what is your connection to quaternions - professional? curiosity? aerospace? animation? - I'm curious. And if you have specific questions I might help with, feel free to email me. I have been tutoring, via email, a PhD candidate in mechanical/aerospace engineering for a couple of years (he's graduating this Spring) and am willing to expand that kind of activity. 

By: Martin Baker (martinbakerProject Admin) - 2007-04-14 10:43
I originally started with writing this computer program here on Sourceforge, I wanted to add animation and physics simulation and so I had to learn about the theory which I documented on the website. 
I found I was not getting much interest from users of the program but a lot of interest in the theory, so I concentrated in that, the more I learn about it the more interesting I find it. 
It would be very good to have a consistent framework for animation and physics simulation, for instance: 
* quaternions are very good for rotations. 
* dual quaternions are very good for solid body movement. 
but they are not so good for say Inertia Tensor? 
So, how do we model a solid object with a set of forces acting on it and use that to calculate the resulting linear and angular accelerations? 
The really difficult bit would be to scale it up to thousands or millions of interacting objects without continually converting between quaternions and matrices or converting between different frames of reference etc. 
Anyway I'll email you directly to see what we can work out. 

metadata block
see also:


Correspondence about this page

Book Shop - Further reading.

Where I can, I have put links to Amazon for books that are relevant to the subject, click on the appropriate country flag to get more details of the book or to buy it from them.


cover The Geometry of Physics : An Introduction

Other Math Books

This site may have errors. Don't use for critical systems.

Copyright (c) 1998-2017 Martin John Baker - All rights reserved - privacy policy.