← Back

Compass & Orientation

DeviceOrientationEvent — compass heading, tilt, and rotation. iOS 13+ requires an explicit permission request; Android fires events automatically.

Compass rose

The rose rotates to show device heading (alpha). Point the top of the device toward north — the N should align with your actual north.

Waiting for orientation events…
Heading α
°
Cardinal
Pitch β
°
Roll γ
°
Alpha (α) is compass heading: 0° = north, 90° = east.
Beta (β) is pitch: 0° = flat, ±90° = vertical.
Gamma (γ) is roll: 0° = flat, ±90° = on its side.

Heading stability

Chart of the last 120 heading samples. A smooth line indicates a stable, usable compass. Noise and jumps indicate interference (metal, electronics) or rapid movement.

Slow rotation to test gimbal lock near ±90° pitch (looking straight up/down causes α to become undefined).