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

sph2car

Transforms 3D spherical coordinates to cartesian coordinates


Description

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

Usage

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

Examples

print(sph2car(45,0,sqrt(2),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.