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

Computes rigorous great circle arc distances between points on the celestial sphere

1 | ```
gcirc(u,ra1,dc1,ra2,dc2)
``` |

`u` |
indicator integer describing units of inputs and outputs: |

`ra1` |
Right Ascension or longitude of point 1 |

`dc1` |
declination or latitude of point 1 |

`ra2` |
Right Ascension or longitude of point 2 |

`dc2` |
declination or latitude of point 2 |

Input position can be in radians, sexigesimal (R.A., Dec), or decimal degrees. The procedure uses the Haversine forumla http://en.wikipedia.org/wiki/Great-circle_distance. The haversine formula can give rounding errors for antipodal points.

If (ra1,dc1) are scalars and (ra2,dc2) are vectors, then *dis* is a vector giving the distance of each element of (ra2,dc2) to (ra1,dc1). Similarly, if (ra1,dc1) are vectors and (ra2,dc2) are scalars, then *dis* is a vector giving the distance of each element of (ra1,dc1) to (ra2,dc2). If both (ra1,dc1) and (ra2,dc2) are vectors then *dis* is a vector giving the distance of each element of (ra1,dc1) to the corresponding element of (ra2,dc2). If the input vectors are not the same length, then excess elements of the longer ones will be ignored.

The astrolib function *sphdist* provides an alternate method of computing
a spherical distance.

`dis` |
angular distance on the sky between points 1 and 2 |

Written in Fortran by R. Hill, SASC Technologies, January 1986

R adaptation by Arnab Chakraborty June 2013

1 | ```
gcirc(2, 100., -35., 180., +35)
``` |

```
[1] 368161.8
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.