GetOrientation()


o() = GetOrientation()

This function returns an array which contains the Azimuth, Pitch and roll. All values are angles in degrees.

Dim o(0)

o() = GetOrientation()

o(0) = Azimuth, angle between the magnetic north direction and the Y axis, around the Z axis (0 to 359). 0=North, 90=East, 180=South, 270=West

o(1) = Pitch, rotation around X axis (-180 to 180), with positive values when the z-axis moves toward the y-axis.

o(2) = Roll, rotation around Y axis (-90 to 90), with positive values when the x-axis moves toward the z-axis.


Important note: For historical reasons the roll angle is positive in the clockwise direction (mathematically speaking, it should be positive in the counter-clockwise direction).

Note: This definition is different from yaw, pitch and roll used in aviation where the X axis is along the long side of the plane (tail to nose).






Become a Patron