Does anyone know of a simple algorithm to calculate the difference between
the desired heading and the actual heading, where the angle is given in
degrees from 0 to 260? The stipulations are that the result must be <= 180.
For example, you can go from 60 to 340 degrees (counter-clockwise), 110 to
280 (clockwise), 290 to 40 (clockwise), etc.  The desired result in the
first case is -80, in the second case, 170, and for the last case, 110.  And
so on ...

The ideal algorithm will have the fewest trivial operations.


Flightgear-devel mailing list

Reply via email to