Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 beta 3/9/83; site sdcrdcf.UUCP Path: utzoo!linus!decvax!ittvax!dcdwest!sdcsvax!sdcrdcf!markb From: markb@sdcrdcf.UUCP Newsgroups: net.puzzle Subject: Re: average wind direction puzzle Message-ID: <1199@sdcrdcf.UUCP> Date: Mon, 16-Jul-84 10:06:23 EDT Article-I.D.: sdcrdcf.1199 Posted: Mon Jul 16 10:06:23 1984 Date-Received: Tue, 17-Jul-84 06:37:09 EDT References: <146@ios.UUCP> Reply-To: markb@sdcrdcf.UUCP (Mark Biggar) Organization: System Development Corporation, Santa Monica Lines: 27 In article <146@ios.UUCP> richa@ios.UUCP (Rich Altmaier) writes: >Consider measuring wind direction with an instrument that gives compass >angles (e.g. 0..359 degrees). Suppose you wish to take several readings >and give an average wind direction. What's a good algorithm for this? > >If you take a set of readings and just numerically average the values, >you may find you never get results near 0/360 and you get lobes near >180 (which won't be correct). Consider a reading set such as >355, 359, 3, 1. Average wind direction is about 359 degrees. > > R. Altmaier > {qubix, oliveb, decwrl}!ios!richa Numerical average only presents a problem if the range of measured values spans across the 0-360 boundry. Assuming that all the measurements are within 180 degrees of each other, (otherwise wind direction is not very well defined), the following procedure should do what you want. 1) if measurements do not span 0 degrees use numerical average. 1) if they span 0 degrees add 180 modulo 360 to each measurement take the numerical average and subtract 180 modulo 360 from the result Mark Biggar {allegra,burdvax,cbosgd,hplabs,ihnp4,sdcsvax}!sdcrdcf!markb