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

car2sph

Transforms 3D cartesian coordinates to spherical coordinates


Description

Transforms 3D cartesian coordinates to spherical coordinates. The user can choose to return the spherical coordinates in degrees or radians.

Usage

car2sph(x, y, z, deg = TRUE)

Arguments

x

x values, can also contain a matrix of x, y and z (in that order).

y

y values.

z

z values

deg

Should degrees be returned (default) or radians.

Details

This is a low level function that is used for plot transformations.

Value

A data.frame is returned containing the columns long (longitude), lat (latitude) and radius.

Author(s)

Aaron Robotham

See Also

Examples

print(car2sph(x=1,y=1,z=0,deg=TRUE))

celestial

Collection of Common Astronomical Conversion Routines and Functions

v1.4.6
GPL-3
Authors
Aaron Robotham
Initial release
2018-11-20

We don't support your browser anymore

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