# Maths - Forum discussion with nhughes

 comments 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.     nhughes

 RE: comments By: Martin Baker (martinbaker) - 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.  https://www.euclideanspace.com/maths/geometry/coordinatesystems/    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:  https://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToEuler/    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.    Thanks,    Martin