Calculating heading distance, and direction

This is quite simple once you realize that headings first need to be normalized to +/- 180 degrees (as opposed to 0-360). Shortest turn is then the normalized difference between the new and current heading. Direction to turn is left for a negative difference and right otherwise.

Example:
Current heading: 270 (normalized to -90)
New heading: 100 (normalized to 100)

Turn = 100 – (-90) = 190 (normalized to -170)

Shortest turn to reach 100 from 270 is then to turn 170 degrees left.

To convert from 0-360 to +/-180 can be done as follows:

groan...
OK, just stopped banging my head on the bench!

Thank you!

I am so glad for his forum!

I'll try that after my walk.