rotate {recexcavAAR} | R Documentation |
Rotate a point cloud around a pivot point (3D)
Description
Rotate a point cloud around a defined pivot point by defined angles. The default rotation angle around each axis is zero and the default pivot point is the center point of the point cloud (defined by mean())
Usage
rotate(x, y, z, degrx = 0, degry = 0, degrz = 0, pivotx = NA_real_,
pivoty = NA_real_, pivotz = NA_real_)
Arguments
x |
vector of x axis values of rotation point cloud |
y |
vector of y axis values of rotation point cloud |
z |
vector of z axis values of rotation point cloud |
degrx |
rotation angle around x axis in degree (default = 0) |
degry |
rotation angle around y axis in degree (default = 0) |
degrz |
rotation angle around z axis in degree (default = 0) |
pivotx |
x axis value of pivot point (default = mean(x)) |
pivoty |
y axis value of pivot point (default = mean(y)) |
pivotz |
z axis value of pivot point (default = mean(z)) |
Value
data.frame with the spatial coordinates of the resulting points
Examples
circ <- draw_circle(0,0,0,5)
#library(rgl)
#plot3d(
# circ,
# xlim = c(-6,6),
# ylim = c(-6,6),
# zlim = c(-6,6)
#)
rotcirc <- rotate(circ$x, circ$y, circ$z, degrx = 45)
#plot3d(
# rotcirc,
# xlim = c(-6,6),
# ylim = c(-6,6),
# zlim = c(-6,6)
#)
[Package recexcavAAR version 0.3.0 Index]