[net.puzzle] wind direction measurement

luong@tonto.DEC (Van Luong Nguyen UHO DTN 264-6560) (07/16/84)

Each reading of wind direction should of course be represented by a vector.
The vector points in the direction the wind is blowing, and the length of the
vector can represent the wind velocity. If wind velocity is not measured, all
vectors will be given unit length.

Several readings are averaged by vector addition.

The easiest way to do vector arithmetic is to remember that a vector of angle
A and length L, is equivalent to a complex number in the form c = (a + bi),
where  i  is the imaginary unit number (i squared = -1), and:

	a = L * cos A
	b = L * sin A

If wind velocity is ignored, then L = 1, and  a = cos A , b = sin A .

If n measurements yield readings c1 = (a1 + b1i), c2, c3, ...,cn , then the
average value c is given by:

	c = (1/n) [ (a1+a2+...+an) + (b1+b2+...+bn)i ]

On the XY plane with center O, c is represented by vector OC, where the
coordinates of C are:  x = (a1+..+an)/n ,  and  y = (b1+...+bn)/n.


Van Luong Nguyen,
Digital Equipment Corporation.
Nashua, New Hampshire.

stekas@hou2g.UUCP (J.STEKAS) (07/18/84)

The correct way to do it is to define a second coordinate system which
is rotated 180 degrees with respect to the initial one.  Now the sample
can be divided into two sub-samples such that each sub-sample contains
measurements between 90-270 degrees in either one coordinate system or
the other. The average direction of each sub-sample can then be calculated
without any problems with the singularity at 0 degrees.  Once that's done
the global average may be calculated by weighting the average of each
sub-sample by the # of measurments in it and adding.  But be sure that
you pick the right (90-270 degree) coordinate system!

Jim