# How do you find the difference in degrees between two headings?

This may be more of a math question, but it is specific to aviation so here goes:

Given an origin heading and a destination heading (origin heading is the heading you're already flying at and destination heading is the heading that you want to turn to), what are the formulas for degrees of separation between those two headings for a left or a right turn?

So if you are heading 190 and you want to go to 020:

The left turn formula should output 170 degrees.

The right turn formula should output 190 degrees.

Figured it out.

LH turn: [origin hdg] - [destination hdg] (if less than 0, add 360)

RH turn: [destination hdg] - [origin hdg] (if less than 0, add 360)

Edit: for the acute angle between two headings you would just take the lower number between these two values. There is no different formula. This is alluded to in this SO post.

By the way, this is not really useful for normal pilots because you can just visualize a compass rose and figure out the different angles pretty easily but I am making a program that will make flying holding patterns a lot easier. You input the inbound leg course (not radial), the wind (direction, velocity), your true airspeed, and whether you are making a left or right hand turn. The program calculates what heading you should turn to on the outbound leg and the heading you should then turn to on the inbound leg (assuming standard rate turn). It also gives you the time to fly on the outbound leg after you reach your heading for that leg. It even takes into account turning from/to different crab angles (which would make the turns more or less than 180 degrees).

• How many degrees is it when the controller tells you to turn a specific direction (left/right)? For example when heading 180°, the controller instructs "turn left heading 270°"? – Ron Beyer Jan 15 '18 at 13:25
• @RonBeyer By the way, the controller will usually add extra words to that instruction to alleviate confusion, "turn left heading 270 long way around." – Wayne Conrad Jan 15 '18 at 16:18
• For a left hand turn it would be (180 - 270) and since that is -90, you add 360 so it's a 270 degree turn. So at standard rate it would take 90 seconds. – Murey Tasroc Jan 15 '18 at 19:14
• BTW, when you have got the angular distance in one direction, the angle in the other direction is just 360° - angle. – mins Jan 15 '18 at 23:50