I have to test whether the difference in degrees between a compass reading and a set point is within x amount.
This post describes what I'm after, it's just in C# and I can't interpret how the solution would work.
E.g...
Compass Reading Set Point Difference (absolute)
360 1 1
50 60 10
1 360 1