sl.uv2uvw | R Documentation |
Convert velocities from local coordinate system (2D) to u-v-w coordinates (3D) on the unit sphere.
sl.uv2uvw(u, v, lon, lat, do.d2r = TRUE)
u , v |
numerical vectors (or scalars) for the velocity components in zonal ( |
lon , lat |
numerical vectors (or scalars) of longitudes ( |
do.d2r |
a logical scalar (default: |
Can be used to transform the u-v vectors in the local "eastward-northward" coordinate system on a sphere into three-dimensional vectors. This facilitates the corresponding vector rotation for a given coordinate rotation.
Returns a list containing
u |
first converted velocity component |
v |
second converted velocity component |
w |
third converted velocity component |
The inverse transformation is implemented in sl.uvw2uv
.
Simon Reifenberg
sl.uvw2uv
# 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.