forked from jdeast/EXOFASTv2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathangsep.pro
executable file
·49 lines (45 loc) · 986 Bytes
/
angsep.pro
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
;+
; NAME:
; angsep
; PURPOSE:
; Compute the angular distance between two spherical coordinates.
; DESCRIPTION:
;
; CATEGORY:
; Mathematical
; CALLING SEQUENCE:
; ans=angsep(ra1,dec1,ra2,dec2)
;
; INPUTS:
; ra1 - RA of first position (radians)
; dec1 - Dec of first position (radians)
; ra2 - RA of second position (radians)
; dec2 - Dec of second position (radians)
;
; OPTIONAL INPUT PARAMETERS:
;
; KEYWORD INPUT PARAMETERS:
;
; OUTPUTS:
; return value is the angular distance in radians.
;
; KEYWORD OUTPUT PARAMETERS:
;
; COMMON BLOCKS:
;
; SIDE EFFECTS:
;
; RESTRICTIONS:
;
; PROCEDURE:
;
; MODIFICATION HISTORY:
; Written by Marc W. buie, Lowell Observatory, 1997/09/08
; 2009/02/26, MWB, added protection against round off error generating NaN
;-
function angsep,ra1,dec1,ra2,dec2
arg = sin(dec1)*sin(dec2)+cos(dec1)*cos(dec2)*cos(ra1-ra2)
arg = ( (arg<1) > (-1) )
angsep=acos(arg)
return,angsep
end