rotate,matrix-method | R Documentation |
Multiple implementations of rotations for coordinate transformation.
## S4 method for signature 'matrix'
rotate(
x,
angles = "random",
long = 0,
lat = 0,
reflong = NULL,
pivot = c(0, 0, 0),
radius = authRadius,
output = "polar"
)
## S4 method for signature 'data.frame'
rotate(x, coords = NULL, ...)
rotate
## S4 method for signature 'trigrid'
rotate(x, angles = "random", pivot = NA, projnote = TRUE)
x |
( |
angles |
( |
long |
( |
lat |
( |
reflong |
( |
pivot |
( |
radius |
The radius of the sphere, relevant only if the |
output |
The output format of the rotations, either |
coords |
( |
... |
Arguments passed to class-specific methods. |
projnote |
( |
An object of class standardGeneric
of length 1.
The function implements 3D rotations of various class of objects, that are ultimately reduced to individual points. Internally, point rotation is implemented with 3-axis rotations (Method 1), that are implemented in the X-Y-Z order (note that 3d rotations are not commutative!). For this reason it is not recommended to re-rotate an already rotated object, unless the purpose is to achieve random orientation.
Method 2 parametrizes rotation with three arguments (long
, lat
, reflong
), that can be easier to control. Longitudinal rotations are invariant to the position of the object, but latitudinal
rotation is not. An axis in the equatorial plane will be set perpendicular to the reference longitude (reflong
)for latitude-based rotation
(i.e. the latitude difference will equal the latitudinal rotation value only at the reference longitude). If this is not given, then the reference longitude will be that of the centroid of the point cloud.
Note that latitudinal rotation is executed first and only then are the points rotated longitudinally.
Same class object as x
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.