mathematics//linear algebra//rotation//Euler angles
Euler angles are a way of describing a 3D rotation as three successive rotations about coordinate axes, in a fixed order, and in vehicles they are the roll, pitch and yaw that pilots, ground stations and log viewers display: three numbers a person can read at a glance. The aerospace convention turns first by yaw \(\psi\) about the vertical, then by pitch \(\theta\) about the new lateral axis, then by roll \(\phi\) about the new longitudinal axis; a drone banked 20° and nosed down 5° while heading 090 is \((\phi,\theta,\psi)=(20^\circ,-5^\circ,90^\circ)\).
Euler angles are a way of describing a 3D rotation as three successive rotations about coordinate axes, in a fixed order, and in vehicles they are the roll, pitch and yaw that pilots, ground stations and log viewers display: three numbers a person can read at a glance. The aerospace convention turns first by yaw ψ\psiψ about the vertical, then by pitch θ\thetaθ about the new lateral axis, then by roll ϕ\phiϕ about the new longitudinal axis; a drone banked 20° and nosed down 5° while heading 090 is (ϕ,θ,ψ)=(20∘,−5∘,90∘)(\phi,\theta,\psi)=(20^\circ,-5^\circ,90^\circ)(ϕ,θ,ψ)=(20∘,−5∘,90∘).
The order is part of the definition. There are twelve possible sequences, and the same three numbers describe different attitudes under different ones, so two programs that exchange Euler angles have to agree on the sequence and on the axes' directions (a large share of attitude bugs are sign or order mismatches between a simulator and an autopilot). Under the convention, the rotation matrix is the product of three elementary rotations, R=Rz(ψ) Ry(θ) Rx(ϕ)R=R_z(\psi),R_y(\theta),R_x(\phi)R=Rz(ψ)Ry(θ)Rx(ϕ), and the angles can be read back from RRR with arctangents.
At a pitch of ±90° one angle disappears: gimbal lock.
With the nose pointing straight up, yawing and rolling turn the vehicle about the same axis, so the three numbers can no longer represent every small rotation, and the equations that turn body rates into angle rates divide by cosθ\cos\thetacosθ:
ψ˙=qsinϕ+rcosϕcosθ,\dot\psi=\frac{q\sin\phi+r\cos\phi}{\cos\theta},ψ˙=cosθqsinϕ+rcosϕ,
with qqq and rrr the pitch and yaw rates measured by the gyroscope. Near vertical flight the computed yaw rate explodes, though the vehicle is turning smoothly. The name comes from mechanical gimbals, nested rings carrying a stabilized platform, which physically lose a degree of freedom when two of their axes line up.
It is a coordinate singularity, a defect of the description and not of the motion, and no choice of three angles avoids it: every three-number parametrization of 3D rotations has one somewhere. That is why autopilots integrate attitude as a quaternion (or a rotation matrix) and convert to Euler angles only for display, logging and for setpoints that a person writes.
Controllers that work in Euler angles are fine where the vehicle never approaches the singularity: a multirotor that never tilts beyond 45°, a ship, a car. Aerobatic aircraft, tail-sitter drones that transition through vertical, and spacecraft cannot use them for estimation or control.
Small angles make them nearly independent and nearly additive, which is why linearized drone models around hover use roll, pitch and yaw directly (linearization); large angles do not commute, as the rotation note shows.