car2sph: Transforms 3D cartesian coordinates to spherical coordinates

Description Usage Arguments Details Value Author(s) See Also Examples

Description

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

Usage

1
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

sph2car

Examples

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

Example output

Loading required package: RANN
Loading required package: NISTunits
Loading required package: pracma
     long lat   radius
[1,]   45   0 1.414214

celestial documentation built on May 2, 2019, 3:05 p.m.