Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

CarToPol

Conversion of 3d Cartesian coordinates to polar coordinates


Description

The function uses basic trigonometric relationships to transform XYZ coordinates to polar coordinates

Usage

CarToPol(x, ...)

## S4 method for signature 'matrix'
CarToPol(x, norad = FALSE, origin = c(0, 0, 0))

## S4 method for signature 'numeric'
CarToPol(x, norad = FALSE, origin = c(0, 0, 0))

## S4 method for signature 'data.frame'
CarToPol(x, norad = FALSE, origin = c(0, 0, 0))

Arguments

x

(matrix, data.frame, numeric) A 3 column data matrix with XYZ coordinates in Cartesian space.

...

Arguments passed to class-specific methods.

norad

(logical). Toggles whether the rho coordinate (distance from origin) should be omitted from the output.

origin

(numeric) Vector with length 3, the XYZ coordinates of the sphere center.

Value

A 3-column or 2-column numeric, matrix or data.frame with longitude, latitude and, if set accordingly, radius data.

Examples

# some random points
xyz <- rbind(
  c(6371, 0,0),
  c(0, 6371,0),
  c(1000,1000,1000)
)

# conversions
  CarToPol(xyz)

icosa

Global Triangular and Penta-Hexagonal Grids Based on Tessellated Icosahedra

v0.10.1
GPL-3
Authors
Adam T. Kocsis [aut, cre]
Initial release
2021-01-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.