cartesian_to_polar: Cartesian to Polar Coordinates

View source: R/cartesian_to_polar.R

cartesian_to_polarR Documentation

Cartesian to Polar Coordinates

Description

Convert from East-North-Up cartesian coordinates to polar coordinates.

Usage

cartesian_to_polar(cartesian, anchor = c(0, 0, 0), digits = NULL)

Arguments

cartesian

A data.table with three columns describing the *XYZ* coordinates of a point cloud.

anchor

A numeric vector of length three which describe the *XYZ* anchor coordinate for reference to get the polar coordinates. It assumes that the reference coordinates are c(X = 0, Y = 0, Z = 0) as default.

digits

A numeric vector of length 1 describing the decimal numbers to round the zenith and azimuth angles. If NULL, round does not apply. NULL as default.

Details

It assumes that the positive *Z* axis is the reference vector for the zenith angle. Likewise, it assumes that the *Y* axis is the north-south direction (positive to negative) for the azimuth angle. If a point from cartesian presents the same *XY* coordinates than anchor, angles returns NA.

Value

A data.table with the zenith and azimuth angles (degrees), and the distance to the anchor coordinate.

Author(s)

J. Antonio Guzmán Q.

See Also

polar_to_cartesian

Examples


data(pc_tree)
cartesian_to_polar(pc_tree)
anchor <- c(1, 1, 1)
cartesian_to_polar(pc_tree, anchor)


rTLS documentation built on Dec. 28, 2022, 1:28 a.m.