| Posted: 08:22am 25 Jun 2021 |
|
|
|
I will prepare both values with MOD to proper range 0-MAX, so you will have for example 2 values 0-359 for angle or 0:00-11:59 for 12-hour clock time. Then if smallest differencemin(max(a,b)-min(a,b), WRAP+min(a,b)-max(a,b)) where WRAP is 360 for angle and 12:00 for time... |