Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Gimbal lock
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==In applied mathematics== {{No footnotes|section|date=July 2013}} The problem of gimbal lock appears when one uses Euler angles in applied mathematics; developers of 3D [[computer program]]s, such as [[3D modeling]], [[inertial guidance system|embedded navigation systems]], and [[video game]]s must take care to avoid it. In formal language, gimbal lock occurs because the map from Euler angles to rotations (topologically, from the 3-torus ''T<sup>3</sup>'' to the [[real projective space]] '''RP'''<sup>3</sup>, which is the same as the space of rotations for three-dimensional rigid bodies, formally named '''[[SO(3)]]''') is not a [[local homeomorphism]] at every point, and thus at some points the [[Rank (differential topology)|rank]] (degrees of freedom) must drop below 3, at which point gimbal lock occurs. Euler angles provide a means for giving a numerical description of any [[rotation]] in three-dimensional space using three numbers, but not only is this description not unique, but there are some points where not every change in the target space (rotations) can be realized by a change in the source space (Euler angles). This is a topological constraint β there is no covering map from the 3-torus to the 3-dimensional real projective space; the only (non-trivial) covering map is from the 3-sphere, as in the use of [[quaternions]]. To make a comparison, all the [[translation (geometry)|translations]] can be described using three numbers <math>x</math>, <math>y</math>, and <math>z</math>, as the succession of three consecutive linear movements along three perpendicular axes <math>X</math>, <math>Y</math> and <math>Z</math> axes. The same holds true for rotations: all the rotations can be described using three numbers <math>\alpha</math>, <math>\beta</math>, and <math>\gamma</math>, as the succession of three rotational movements around three axes that are perpendicular one to the next. This similarity between linear coordinates and angular coordinates makes Euler angles very [[intuition (knowledge)|intuitive]], but unfortunately they suffer from the gimbal lock problem. ===Loss of a degree of freedom with Euler angles=== A rotation in 3D space can be represented numerically with [[matrix (mathematics)|matrices]] in several ways. One of these representations is: :<math>\begin{align} R &= \begin{bmatrix} 1 & 0 & 0 \\ 0 & \cos \alpha & -\sin \alpha \\ 0 & \sin \alpha & \cos \alpha \end{bmatrix} \begin{bmatrix} \cos \beta & 0 & \sin \beta \\ 0 & 1 & 0 \\ -\sin \beta & 0 & \cos \beta \end{bmatrix} \begin{bmatrix} \cos \gamma & -\sin \gamma & 0 \\ \sin \gamma & \cos \gamma & 0 \\ 0 & 0 & 1 \end{bmatrix} \end{align} </math> An example worth examining happens when <math>\beta = \tfrac{\pi}{2}</math>. Knowing that <math>\cos \tfrac{\pi}{2} = 0</math> and <math>\sin \tfrac{\pi}{2} = 1</math>, the above expression becomes equal to: :<math>\begin{align} R &= \begin{bmatrix} 1 & 0 & 0 \\ 0 & \cos \alpha & -\sin \alpha \\ 0 & \sin \alpha & \cos \alpha \end{bmatrix} \begin{bmatrix} 0 & 0 & 1 \\ 0 & 1 & 0 \\ -1 & 0 & 0 \end{bmatrix} \begin{bmatrix} \cos \gamma & -\sin \gamma & 0 \\ \sin \gamma & \cos \gamma & 0 \\ 0 & 0 & 1 \end{bmatrix} \end{align} </math> Carrying out [[matrix multiplication]]: :<math>\begin{align} R &= \begin{bmatrix} 0 & 0 & 1 \\ \sin \alpha & \cos \alpha & 0 \\ -\cos \alpha & \sin \alpha & 0 \end{bmatrix} \begin{bmatrix} \cos \gamma & -\sin \gamma & 0 \\ \sin \gamma & \cos \gamma & 0 \\ 0 & 0 & 1 \end{bmatrix} = \begin{bmatrix} 0 & 0 & 1 \\ \sin \alpha \cos \gamma + \cos \alpha \sin \gamma & -\sin \alpha \sin \gamma + \cos \alpha \cos \gamma & 0 \\ -\cos \alpha \cos \gamma + \sin \alpha \sin \gamma & \cos \alpha \sin \gamma + \sin \alpha \cos \gamma & 0 \end{bmatrix} \end{align} </math> And finally using the [[trigonometry formulas#Angle sum and difference identities|trigonometry formulas]]: :<math>\begin{align} R &= \begin{bmatrix} 0 & 0 & 1 \\ \sin ( \alpha + \gamma ) & \cos (\alpha + \gamma) & 0 \\ -\cos ( \alpha + \gamma ) & \sin (\alpha + \gamma) & 0 \end{bmatrix} \end{align} </math> Changing the values of <math>\alpha</math> and <math>\gamma</math> in the above matrix has the same effects: the rotation angle <math>\alpha + \gamma</math> changes, but the rotation axis remains in the <math>Z</math> direction: the last column and the first row in the matrix won't change. The only solution for <math>\alpha</math> and <math>\gamma</math> to recover different roles is to change <math>\beta</math>. It is possible to imagine an airplane rotated by the above-mentioned Euler angles using the '''X-Y-Z''' convention. In this case, the first angle - <math>\alpha</math> is the pitch. Yaw is then set to <math>\tfrac{\pi}{2}</math> and the final rotation - by <math>\gamma</math> - is again the airplane's pitch. Because of gimbal lock, it has lost one of the degrees of freedom - in this case the ability to roll. It is also possible to choose another convention for representing a rotation with a matrix using Euler angles than the '''X-Y-Z''' convention above, and also choose other variation intervals for the angles, but in the end there is always at least one value for which a degree of freedom is lost. The gimbal lock problem does not make Euler angles "invalid" (they always serve as a well-defined coordinate system), but it makes them unsuited for some practical applications. ===Alternate orientation representation=== The cause of gimbal lock is the representation of orientation in calculations as three axial rotations based on Euler angles. A potential solution therefore is to represent the orientation in some other way. This could be as a [[rotation matrix]], a quaternion (see [[quaternions and spatial rotation]]), or a similar orientation representation that treats the orientation as a value rather than three separate and related values. Given such a representation, the user stores the orientation as a value. To quantify angular changes produced by a transformation, the orientation change is expressed as a delta angle/axis rotation. The resulting orientation must be re-normalized to prevent the accumulation of [[Floating point#Accuracy problems|floating-point error]] in successive transformations. For matrices, re-normalizing the result requires converting the matrix into its [[orthonormal matrix#Nearest orthogonal matrix|nearest orthonormal representation]]. For quaternions, re-normalization requires [[unit quaternions|performing quaternion normalization]].
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)