Learn R Programming

retistruct (version 0.6.3)

rotate.axis: Rotate axis of sphere

Description

This rotates points on sphere by specifying the direction its polar axis, i.e. the axis going through (90, 0), should point after (a) a rotation about an axis through the points (0, 0) and (0, 180) and (b) rotation about the original polar axis.

Usage

rotate.axis(r, r0)

Arguments

r

Coordinates of points in spherical coordinates represented as 2 column matrix with column names phi (latitude) and lambda (longitude).

r0

Direction of the polar axis of the sphere on which to project represented as a 2 column matrix of with column names phi (latitude) and lambda (longitude).

Value

2-column matrix of spherical coordinates of points with column names phi (latitude) and lambda (longitude).

Examples

Run this code
# NOT RUN {
r0 <- cbind(phi=0, lambda=-pi/2)
r <- rbind(r0, r0+c(1,0), r0-c(1,0), r0+c(0,1), r0-c(0,1))
r <- cbind(phi=pi/2, lambda=0)
rotate.axis(r, r0)
# }

Run the code above in your browser using DataLab