Re: Algorithm to find the shortest rotation using degrees?
by "m0rdred" <idlerstyle@[EMAIL PROTECTED]
>
Oct 27, 2006 at 10:18 PM
> int fn(int start, int end)
> {
> while ((start - target) > 180) start -= 360;
> while ((start - target) < -180) start += 360;
>
> if (start < target) return 1;
> else if (start > target) return -1;
> else return 0;
> }
By the way, this baby works like a charm! Nice job!
Thanks
Scott I