If I understand what you are proposing, this would remove the problem at zero deg and shift the error to 180 deg. For example if you have (179, -179) this averages to 0, which of course, is wrong. Regards, Gordon Williams ----- Original Message ----- From: "Walter Banks" To: "Microcontroller discussion list - Public." Sent: Thursday, September 16, 2004 8:56 AM Subject: Re: [OT] cyclic average. > 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. > > w.. _______________________________________________ http://www.piclist.com View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist