Learn R Programming

astrolibR (version 0.1)

sphdist: Distance on a sphere

Description

Angular distance between two points on a sphere, specified by longitude and latitude

Usage

sphdist(long1, lat1, long2, lat2, degrees = FALSE)

Arguments

long1
Longitude of the first point
lat1
Latitude of the first point
long2
Longitude of the second point
lat2
Latitude of the second point
degrees
Flag denoting whether input angles are in degrees or radians

Value

dis
Angle, in degrees or radians

Details

The distance is computed after conversion from spherical to rectangular coordinates.

See Also

gcirc

Examples

Run this code
sphdist(2, 100, -35, 180, +35)
  

Run the code above in your browser using DataLab