Since GPS, navigation and astronomy all perform calculations on angles, why not have a dedicated angle data type that would compress location data and simplify trigonometric calculations? Allow me to introduce you to the angle type.

I think of a primitive as a value that can be placed in a machine register. Values like char, int, long, float, double and boolean come to mind. The angle primitive has two fields: a boolean pi-bit and a fixed-point field designed to hold a value between -1.0 up to but not including 1.0. Let the fixed point value be the tangent of the half angle. The arctangent is a value between -pi/4 and +pi/4. Twice the arctangent ranges between -pi/2 and pi/2. The pi bit adds or subtracts pi yielding an angle between -pi and pi; a full circle. In the following illustration the pi bit is in orange and the fixed point value is in green.

continue