rotate.sphwin: Rotate a Spherical Window or Spherical Point Pattern

View source: R/rotation.R

rotate.sphwinR Documentation

Rotate a Spherical Window or Spherical Point Pattern

Description

These functions apply a rotation to a given spherical window or spherical point pattern.

Usage

## S3 method for class 'sphwin'
rotate(X, northpole, inverse = FALSE, ...)

## S3 method for class 'sp2'
rotate(X, northpole, inverse = FALSE, ...)

## S3 method for class 'sp3'
rotate(X, northpole, inverse = FALSE, ...)

Arguments

X

Window or point pattern to be rotated: an object of class "sphwin", "sp2" or "sp3".

northpole

A point that will be rotated to the north pole (if inverse=FALSE, the default) or a point to which the north pole should be rotated (if inverse=TRUE). A numeric vector of length 2 containing polar coordinates (colatitude, longitude) in radians.

inverse

Logical value. If FALSE (the default), the rotation will be such that the point specified by northpole will move to the position of the north pole of the sphere. If TRUE, the rotation will be such that the north pole of the sphere will be rotated to the position given by northpole.

...

Ignored.

Details

These functions are methods for the generic rotate for the classes "sphwin", "sp2" and "sp3" representing spherical windows and point patterns.

A rotation on the sphere can be specified by stipulating that a point at position A should move to position B, where A,B are any given points on the sphere. The functions here assume that either A or B is the north pole.

If inverse=FALSE (the default), the sphere is rotated so that the point specified by northpole moves to the north pole. If inverse=TRUE, the sphere is rotated so that the north pole is moved to the position specified by northpole.

To apply a general rotation which moves point A to point B, use rotate(rotate(X, A), B, inverse=TRUE). This performs two rotations: the first rotation sends A to the north pole, the second sends the north pole to B.

Value

Another object of the same kind as X representing the result of rotation.

Author(s)

Tom Lawrence and Adrian Baddeley

Examples

  sphcap <- sphwin(type="band", param=c(0, pi/3), ref=c(pi/8,pi/6))  
  X <- runif.sphwin(30, sphcap)
  X
  Y <- rotate(X, c(0, pi/3))
  Y

baddstats/spherstat documentation built on Feb. 6, 2023, 1:45 a.m.