Skip to contents

This function takes a vector of u and v velocities and calculates the direction and speed of the combined movement.

Usage

vectors_2_direction(u, v)

Arguments

u

A vector of Zonal currents (from West to East).

v

A vector of Meridional currents (from South to North).

Value

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.

Details

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.

See also

Other NEMO-MEDUSA spatial tools: Update-drivers, Window(), sfc_as_cols()