[wxqc] Text to Degrees

Steve Dimse steve at dimse.com
Sun Apr 8 14:09:03 CDT 2007


On Apr 8, 2007, at 2:32 PM, Evan Bookbinder wrote:

> To determine average wind direction without having the 0 to 360  
> cross over
> problem, winds are broken down to their U (east/west) and V (north/ 
> south)
> components with the origin being in the center at calm. This  
> ensures proper
> averaging irrespect to the arbitrary numeric values assigned in the  
> compass.
>
> For example, a due west wind of X mph would have a 100% positive U  
> value of
> X and 0 for V; north would be 0,-X; east would be -X,0; and south  
> wind would
> be 0,X. Other wind directions would be broken down into U and V  
> using proper
> trigonometry.

That is one way to do it. I use something I find simpler to prevent  
the 360 problem. With each incoming value, I vector add the new value  
with a weight of 1/n. The first reading starts the average, the  
second moves the average 1/2 of the way towards the new reading, the  
third reading moved the average 1/3 of the way towards that new  
reading, the fourth moves the average 1/4 of the way to that new  
reading, and so on. In this way there is only one accumulated vector  
and it is always ready for output, nice when running the averaging  
and output routines as separate processes.

Steve K4HG


More information about the wxqc mailing list