polar_to_cartesian: Polar to Cartesian Coordinates

Description Usage Arguments Value Author(s) See Also Examples

View source: R/polar_to_cartesian.R

Description

Convert from polar to cartesian coordinates.

Usage

1
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(s)

J. Antonio Guzmán Q.

See Also

cartesian_to_polar

Examples

1
2
3
4
5
6
7
8
#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)

Antguz/rTLS documentation built on Dec. 14, 2021, 9:49 a.m.