Angle difference between two bearings: Difference between revisions

(→‎{{header|J}}: J uses the mathematical mod, so fancy positivity manipulations are unnecessary.)
Line 87:
</pre>
=={{header|APL}}==
Returns an angle in (-180,180]; so two opposite bearings are have a difference of 180 degrees, which is more natural than -180 degrees.
<lang APL>[0] D←B1 DIFF B2
[1] D←180+¯360|180+B2-B1
Anonymous user