View source: R/wind_functions2.R
| uv2ds | R Documentation |
Transform U and V components in direction and speed and vice versa
uv2ds(u, v)
ds2uv(d, s)
u |
U component. |
v |
U component. |
d |
direction (degrees). |
s |
speed (m/s). |
uv2ds() returns a numeric matrix with columns dir (degrees
clockwise from north, towards where the flow moves) and speed (in the
same units as U and V), with one row per input pair.
ds2uv() returns a numeric matrix with columns u (eastward
component) and v (northward component), in the same units as s, with
one row per direction-speed pair.
Multiple U and V values can be processed. "dir" denotes where the wind/sea current is going (toward), not from where is coming.
Javier Fernández-López (jflopez.bio@gmail.com)
wind.mean, wind2raster
(ds <- uv2ds(c(1, 1, 3, 1), c(1, 1.7, 3, 1)))
ds2uv(ds[, 1], ds[, 2])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.