Quote Originally Posted by wjsmarine View Post
Basic enough but the problem arises where prevailing conditions see the wind coming from a Northerly aspect where one sample may be less than 359 degrees while the next (or previous) is greater than 0. Normal averaging would see two consecutive samples (say 350 and 10 degrees) as 180 but this is obviously incorrect, it should be 0 (360) degrees.
Regards,
Bill
Off the top of my head...how about something like taking the sin & cos of each angle sample, averaging those numbers, and then converting the sin & cos average result back to an angle. I don't remember what that's called at the moment, sum of the squares, something along those lines...