home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
cpm
/
basic
/
astrmenu.lbr
/
ANGULR.BZS
/
ANGULR.BAS
Wrap
BASIC Source File
|
1987-04-26
|
1KB
|
44 lines
1 PRINT "From the August 1984 SKY & TELESCOPE, pp. 158-9."
2 PRINT
3 PRINT "This program calculates the angular separation of one star or planet"
4 PRINT "from another."
5 PRINT
6 PRINT "INPUT: First and second stars' right ascension (h, min, s) and"
7 PRINT " declination (degrees, min, sec)."
8 PRINT
9 PRINT "OUTPUT: Separation in degrees, arc seconds." : PRINT
10 REM ANGULAR SEPARATION
12 REM
14 P=3.14159265# : C=P/180
16 PRINT "FIRST STAR--"
18 INPUT "R.A. (H,MIN,S) ";A$,A2,A3
20 GOSUB 60 : R1=A*15*C
22 INPUT "DEC. (DEGREES,MIN,S)";A$,A2,A3
24 GOSUB 60 : D1=A*C
26 PRINT
28 PRINT "SECOND STAR--"
30 INPUT "R.A. (H,MIN,S) ";A$,A2,A3
32 GOSUB 60 : R2=A*15*C
34 INPUT "DEC. (DEGREES,MIN,S)";A$,A2,A3
36 GOSUB 60 : D2=A*C
38 REM
40 D=SIN((D1-D2)/2) : H1=D*D
42 A=SIN((R1-R2)/2) : H2=A*A
44 H3=H1+COS(D1)*COS(D2)*H2
46 S1=SQR(H3) : C1=SQR(1-S1*S1)
48 S=2*ATN(S1/C1)/C
50 PRINT
52 PRINT "SEPARATION--"
54 PRINT " IN DEGREES: ";S
56 PRINT " IN ARC SECONDS: ";S*3600
58 RUN"ASTRMENU.BAS"
60 REM SEXAGESIMAL TO DECIMAL
62 REM
64 F=1 : A1=ABS(VAL(A$))
66 IF LEFT$(A$,1)="-" THEN F=-1
68 A=F*(A1+A2/60+A3/3600)
70 RETURN
XAGESIMAL TO DECIMAL
62 REM
64 F=1 : A1=ABS(VAL(A$))
66 IF LEFT$(A$,1)="-"