Walter, On Thu, 16 Sep 2004 08:56:46 -0400, Walter Banks wrote: > The problem is the discontinuity in the number system being used. Creating a continuous wrap around number system representing the compass as 0 to 179 180 -179 to -1 makes all of the averaging problems go away. Conversion of negative numbers requires a simple add of 360. I think you've just shifted the problem 180 degrees: average of -1 and 1 is 0, which is correct. But the average of -179 and 179 is also 0, which is wrong (should be 180 or -180). Cheers, Howard Winter St.Albans, England _______________________________________________ http://www.piclist.com View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist