What Skip was talking about in the post above would only really work under ideal conditions.
Jane: I would not even worry about the Pythagorean theorem as vector calculations are easier to apply in this use case. I spent a good bit of time researching this topic on my own and found some good resources online. Interestingly enough I found the answer within the marine and boating community. I can't recall what site I got the information from but I saved the calculations in a document and will list them below.
Vehicle:
Speed and direction derived via GPS while in motion, otherwise digital compass is supplemented in while stationary.
SOG: Speed Over Ground
COG: Course Over Ground
Anemometer:
This is the wind relative to the vehicle.
AWS: Apparent Wind Speed
AWD: Apparent Wind Direction
True Wind:
The derived estimate wind speed/direction as though you were stationary while in motion.
TWS: True Wind Speed
TWD: True Wind Direction
Finding the vector components of the apparent wind:
a = (AWS)cos(AWD)
b = (AWS)sin(AWD)
Finding the vector components of vehicle speed/direction:
c = (SOG)cos(COG)
d = (SOG)sin(COG)
Now to subtract the vehicle motion from the apparent wind observation:
u = c - a
v = d - b
An alternative way to find the true wind components is to do everything in one step. For the purposes of this post, I've shown the long and below show the short way.
The alternative does everything in one go, and is probably the preferred option given it's more efficient:
u = (SOG)cos(COG) - (AWS)cos(AWD)
v = (SOG)sin(COG) - (AWS)sin(AWD)
With true wind now derived as u and v components, all that is left to do is calculate wind speed and direction.
True wind speed is pretty straight forward:
TWS = SQRT((
u*
u)+(
v*
v))
Find the square root of the added combination of each squared component.
True wind direction calculation is a little more involved however. Because of how the cartesian plain works, each quadrant requires its own separate formula (I'm not an expert on mathematics so I couldn't tell you why this is, it just is, I'm sure a google search could yield some results).
I put together and labeled the corresponding quadrants with the component values. The output for true wind direction is denoted as theta θ. In a computer program or logger software the output can automatically be supplemented.
QUADRANT I
u > 0
v > 0
θ = arctan(
v/
u)
QUADRANT II
u < 0
v > 0
θ = 180 + arctan(
v/
u)
QUADRANT III
u < 0
v < 0
θ = 180 + arctan(
v/
u)
QUADRANT IV
u > 0
v < 0
θ = 360 + arctan(
v/
u)
So now determining true wind direction is as straight forward as:
TWD =
θ
I hope this clears up your confusion and helps anyone looking for information on this topic.
More information on wind component vectors can be found
here.
Cheers