vectors_2_direction | R Documentation |
This function takes a vector of u and v velocities and calculates the direction and speed of the combined movement.
vectors_2_direction(u, v)
u |
A vector of Zonal currents (from West to East). |
v |
A vector of Meridional currents (from South to North). |
This function was lifted from the ‘Rsenal' package, where it was originally used to calculate wind speeds. All I’ve done is built a wrapper which accounts for different conventions when describing wind and flow directions.
a dataframe of two columns is returned. Speed contains the composite speed of both velocities on the same scale. Direction is the resolved direction of the flow in degrees, 0 heads north, 90 East, 180 South, 270 West.
Other NEMO-MEDUSA spatial tools:
Update-drivers
,
Window()
,
sfc_as_cols()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.