Convert from polar to cartesian coordinates.

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.

Author

J. Antonio Guzmán Q.

Examples


#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)