sl.uvw2uv: Coordinate transformation of velocity vectors (3D -> 2D)

View source: R/sl.uvw2uv.R

sl.uvw2uvR Documentation

Coordinate transformation of velocity vectors (3D -> 2D)

Description

Convert velocities from u-v-w coordinates (3D) on the unit sphere to u-v-components in local coordinate system (2D).

Usage

sl.uv2uvw(u, v, w, lon, lat, do.d2r = TRUE)

Arguments

u, v, w

numerical vectors (or scalars) for the velocity components.

lon, lat

numerical vectors (or scalars) of longitudes (lon) and latitudes (lat) of the velocity vectors.

do.d2r

a logical scalar (default: TRUE), specifying whether longitude and latitude are interpreted as radian (FALSE) or degrees (TRUE).

Value

Returns a list containing

u

first converted velocity component in local coordinate system

v

second converted velocity component in local coordinate system

Note

The inverse transformation is implemented in sl.uv2uvw.

Author(s)

Simon Reifenberg

See Also

sl.uv2uvw

Examples

# 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)


FESOM/spheRlab documentation built on April 6, 2024, 6:52 p.m.