five-on-it / packages/shared/src/math / compassBearing
Function: compassBearing()
compassBearing(
yaw):number
Defined in: packages/shared/src/math.ts:48
The compass bearing of a yaw, in degrees [0, 360), for people to read: 0 is north (+z, up the screen), and it turns clockwise as the screen shows the world, so 90 is east (-x, the screen's right), 180 south (-z) and 270 west (+x, the screen's left). The yaw turns the other way (+π/2 faces +x), so the bearing is the yaw with its sign changed.
Parameters
yaw
number
Returns
number