Learn R Programming

spherepc (version 0.1.2)

Rotate: Rotating point on sphere

Description

Rotate a point on the unit sphere.

Usage

Rotate(pt1, pt2)

Arguments

pt1

a spatial location.

pt2

a spatial location.

Value

three-dimensional vector.

Details

This function rotates pt2 to the extent that pt1 to spherical coordinate (0, 90). The function returns a point as a form of three-dimensional Euclidean coordinate.

References

https://en.wikipedia.org/wiki/Rodrigues_rotation_formula

See Also

Rotate.inv.

Examples

Run this code
# NOT RUN {
## If "pt1" is north pole (= (0, 90)), then \code{Rotate} returns Euclidean coordinate of "pt2".
Rotate(c(0, 90), c(10, 10))   # It returns Euclidean coornate of spatial location (10, 10).
# \code{Trans.Euclid} converts spatial coordinate (10, 10) to Euclidean coordinate.
Trans.Euclid(c(10, 10))       
# }

Run the code above in your browser using DataLab