sph2car: Transforms 3D spherical coordinates to cartesian coordinates

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

Description

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

Usage

1
sph2car(long, lat, radius = 1, deg = TRUE)

Arguments

long

Longitude values, can also contain a matrix of long, lat and radius (in that order).

lat

Latitude values.

radius

Radius values.

deg

Specifies if input is in degrees (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 x, y and z.

Author(s)

Aaron Robotham

See Also

coordmatch

Examples

1
print(sph2car(45,0,sqrt(2),deg=TRUE))

Example output

Loading required package: RANN
Loading required package: NISTunits
Loading required package: pracma
     x y z
[1,] 1 1 0

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