Learn R Programming

rTLS (version 0.2.3)

polar_to_cartesian: Polar to Cartesian Coordinates

Description

Convert from polar to cartesian coordinates.

Usage

polar_to_cartesian(polar, threads = 1, digits = NULL)

Arguments

polar

A data.table with three columns describing the zenith, azimuth, and distance of a point to the center.

threads

An integer vector describing the number of threads for parallel processing. Default 1.

digits

A numeric vector of length 1 describing the decimal numbers to round the cartesian coordinates. If NULL, round does not apply. NULL as default.

Value

A data.table with three columns describing the *XYZ* of the cartesian coordinates.

See Also

cartesian_to_polar

Examples

Run this code
# NOT RUN {
#Creates a hemisphere of points each 2 degrees

zenith <- seq(0, 90, 2)
azimuth <- seq(0, 360, 2)
hemi <- CJ(zenith, azimuth)
hemi$distance <- 1
hemicloud <- polar_to_cartesian(hemi)
rgl::plot3d(hemicloud)

# }

Run the code above in your browser using DataLab