Gravity fixes which way is up, so roll and pitch come out drift-free. Yaw has no such anchor — it is pure integration, and it only survives because everything springs slowly back to centre.
Sideways and vertical motion is recovered from rotation about a pivot behind the phone — your wrist. No double integration, so nothing runs away.
Calibration runs first: rock the phone side to side, then tilt it forward and back.
Yaw swings the phone sideways about your wrist, pitch swings it up and down. The window moves the opposite way, one to one in millimetres — so it appears to stay put in the room.
How far behind the screen you are pivoting. Wrist is roughly 15–20 cm, elbow 35–45 cm. Displacement scales as L · sin θ, so this is a straight gain on how far the window travels.
100 % is true world-lock: 25 mm of phone movement, 25 mm of window movement. Honest, and it eats the screen fast. Below 100 % breaks the lock slightly and nobody notices.
High-pass on pitch and yaw. Deliberate movement drifts back to centre so you never hit the edge — and since yaw is unanchored gyro integration, this is also the only thing keeping its drift bounded.
Extrapolates forward along the current turn rate to cancel sensor‑to‑screen delay. Too much and fast flicks overshoot and snap back.
Accelerometer anchors the angle, gyroscope smooths it. This is the one you ship.
Detecting…
The spec puts the screen-normal rate in α, but WebKit maps its channels straight onto CoreMotion's x/y/z, so on iOS roll lands in γ. Roll and pitch are found by correlating each channel against gravity; yaw is the channel left over, and its sign follows from handedness.
Gravity sign: normal.