sl.rot: Coordinate Rotation on Sphere

sl.rotR Documentation

Coordinate Rotation on Sphere

Description

Rotate points on a sphere.

Usage

sl.rot(lon, lat, alpha, beta, gamma, return.xyz = FALSE, invert = FALSE)

Arguments

lon

a scalar or vector specifying the longitude(s) of the point(s) to be rotated.

lat

a scalar or vector specifying the latitude(s) of the point(s) to be rotated.

alpha

a scalar specifying the alpha parameter for the rotation. See the code for details.

beta

a scalar specifying the beta parameter for the rotation. See the code for details.

gamma

a scalar specifying the gamma parameter for the rotation. See the code for details.

return.xyz

a logical value indicating whether or not the resulting points shall also be returned in x-y-z coordinates.

invert

a logical value indicating whether or not the rotation shall be inverted.

Details

The parameters alpha, beta, and gamma can be derived from more intuitive parameters for the original coordinates of the new North Pole and the angle (in degrees) of rotation around the new North Pole using sl.lonlatrot2abg.

Value

A list with the following elements:

lon

a scalar or vector giving the longitude(s) or the rotated point(s)

lat

a scalar or vector giving the latitude(s) or the rotated point(s)

If return.xyz=TRUE, also the following elements are added to the list:

x

a scalar or vector giving the x-coordinate(s) or the rotated point(s)

y

a scalar or vector giving the y-coordinate(s) or the rotated point(s)

z

a scalar or vector giving the z-coordinate(s) or the rotated point(s)

Author(s)

Helge Goessling

See Also

sl.lonlatrot2abg

Examples

abg = sl.lonlatrot2abg(lonlatrot=c(20,30,-45))
sl.rot(lon=c(0,10,20),lat=c(0,0,0),alpha=abg[1],beta=abg[2],gamma=abg[3])
## Should return:
## $lon
## [1] -81.05239 -64.42540 -45.00000
## 
## $lat
## [1] 54.46865 58.52505 60.00000

helgegoessling/spheRlab documentation built on April 8, 2024, 8:34 a.m.