geo2sph: Convert geographic to spherical coordinates

Description Usage Arguments Value Examples

View source: R/Conversion.R

Description

Convert latitude (lat) and longitude (lon) to spherical coordinates (theta, phi) with theta in [0,pi] and phi in [0,2*pi). All values lat, lon, theta, phi are assumed to be in radians.

Usage

1

Arguments

...

A data.frame with columns lat and lon, or named vectors of lat and lon.

Value

A data.frame with columns theta and phi.

Examples

1
2
3
4
geo <- data.frame( lat = c(0, pi/3, pi/2), lon = c(0, pi/3, pi))
geo
sph <- geo2sph(geo)
sph

rcosmo documentation built on Dec. 11, 2021, 9:29 a.m.