Learn R Programming

rTLS (version 0.2.3)

rotate2D: Rotate a plane of coordinates

Description

Rotate a plane of coordinates to a given angle.

Usage

rotate2D(plane, angle, threads = 1)

Arguments

plane

A data.table with two columns describing the plane of coordinates.

angle

A numeric vector describing the degrees of rotation.

threads

An integer specifying the number of threads to use. Experiment to see what works best for your data on your hardware.

Value

A data.table with the rotation applied to plane.

Examples

Run this code
# NOT RUN {
data(pc_tree)

plot(pc_tree[,1:2])

#Rotate in 45 degrees using Z axis of the cloud
plot(rotate2D(pc_tree[,1:2], angle = 45))

# }

Run the code above in your browser using DataLab