sl.uvw2uv | R Documentation |
Convert velocities from u-v-w coordinates (3D) on the unit sphere to u-v-components in local coordinate system (2D).
sl.uv2uvw(u, v, w, lon, lat, do.d2r = TRUE)
u , v , w |
numerical vectors (or scalars) for the velocity components. |
lon , lat |
numerical vectors (or scalars) of longitudes ( |
do.d2r |
a logical scalar (default: |
Returns a list containing
u |
first converted velocity component in local coordinate system |
v |
second converted velocity component in local coordinate system |
The inverse transformation is implemented in sl.uv2uvw
.
Simon Reifenberg
sl.uv2uvw
# define local velocity vectors at three positions
lon = c(0, 45, 90)
lat = c(0, 45, 0)
u = c(0, sqrt(2)/2, 1)
v = c(1, sqrt(2)/2, 0)
# convert to 'global' coordinates
U <- sl.uv2uvw(u, v, lon, lat)
print(U)
# convert back to local coordinates
U.loc <- sl.uvw2uv(U$u, U$v, U$w, lon, lat, do.d2r = T)
print(U.loc)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.