View source: R/derived_values.R
res_wind_speed | R Documentation |
Calculate the resultant wind speed and direction from a collection of wind speeds and directions.
res_wind_speed(speed, dir, na.rm = TRUE) res_wind_dir(speed, dir, na.rm = TRUE)
speed |
Wind speeds. |
dir |
Wind directions in degrees clockwise from north. |
na.rm |
A logical value indicating whether |
Resultant wind speeds are vector-averaged. We first find the average values of the east-west and north-south components,
Ve = -sum(u_i * sin(theta_i)) / N
Vn = -sum(u_i * cos(theta_i)) / N
where u is the speed and theta is the direction. The resultant speed and direction can then be calculated with
U_R = sqrt(Ve^2 + Vn^2)
theta_R = arctan(Ve/Vn) + 180
res_wind_speed
returns the resultant wind
speed. res_wind_dir
returns the resultant wind direction.
us_environmental_protection_agency_meteorological_2000atmoschem.process
# opposite winds cancel out res_wind_speed(1, c(0, 180)) # A scalar average would return 180 in this case. Resultant wind direction # produces the correct value. res_wind_dir(1, c(355, 5))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.