mathematics//linear algebra//rotation
A rotation is a linear transformation that turns space about the origin without deforming it, written as an orthogonal matrix with determinant +1, and its everyday job in robotics is to move vectors between frames: what a sensor measures in the drone's own axes has to be expressed in Earth's axes before it can be integrated, compared with GPS or fed to a position controller. A rotation matrix \(R\) keeps lengths and angles, so its inverse is its transpose.
A rotation is a linear transformation that turns space about the origin without deforming it, written as an orthogonal matrix with determinant +1, and its everyday job in robotics is to move vectors between frames: what a sensor measures in the drone's own axes has to be expressed in Earth's axes before it can be integrated, compared with GPS or fed to a position controller. A rotation matrix RRR keeps lengths and angles, so its inverse is its transpose.
aEarth=R abody,RTR=I,detR=+1a^{\text{Earth}}=R\,a^{\text{body}},\qquad R^{\mathsf T}R=I,\qquad \det R=+1aEarth=Rabody,RTR=I,detR=+1
An accelerometer strapped to a drone measures in body axes. To know how the drone accelerates over the ground, the autopilot rotates each reading into the Earth frame with its current attitude estimate, subtracts gravity and integrates. Every error in RRR leaks gravity into the horizontal axes: a tilt error of 1° puts 9.81sin1∘≈0.17 m/s29.81\sin 1^\circ\approx0.17\ \text{m/s}^29.81sin1∘≈0.17 m/s2 of false acceleration into the horizontal, which integrated twice is about 8.6 m of position error after ten seconds. This is why attitude is estimated so carefully and why dead reckoning on cheap sensors drifts so fast.
Order matters in three dimensions.
Yawing 90° and then pitching 90° leaves a body in a different attitude from pitching and then yawing, because rotation matrices do not commute; chains of frame changes (sensor to body, body to navigation frame) are multiplied in a fixed order and documented with it.
A 3D rotation has three degrees of freedom, and how they are stored is an engineering choice with costs. The matrix holds nine numbers tied by six constraints, is the easiest to apply and drifts from orthogonality when integrated. Euler angles (roll, pitch, yaw) are three intuitive numbers that hit a coordinate singularity at a pitch of ±90°, known as gimbal lock, where roll and yaw become the same motion. The quaternion stores four numbers with one constraint and no singularity, which is why autopilots keep attitude in it.
In two dimensions rotations commute and one angle is enough, which is why a planar drone model keeps a single θ\thetaθ and the trouble above only appears in full 3D attitude.
A rotation has no real direction left unchanged in the plane, so its eigenvalues are a complex pair e±jθe^{\pm j\theta}e±jθ; in 3D the one real eigenvector, with eigenvalue 1, is the axis it turns about.
Calibration matrices are often rotations in disguise: the misalignment between an IMU's axes and the airframe's is a small rotation estimated once on the bench, and getting its sign or order wrong reproduces the gravity leak above (sensor calibration).