10 REM   SPACE MOTION OF A STAR
12 REM
14 P1=3.14159265
16 INPUT "R.A. (H,M)";H,M
18 A=(H+M/60)*15*P1/180
20 INPUT "ANNUAL PM (SEC)";DA
22 INPUT "DEC. (D,M)";D$,M
24 D=ABS(VAL(D$)): S=1
26 IF LEFT$(D$,1)="-" THEN S=-1
28 D=S*(D+M/60)*P1/180
30 INPUT "ANNUAL PM (ARCSEC)";DD
32 DA=DA/13751: DD=DD/206265
34 INPUT "R.V. (KM/SEC)";DR
36 DR=DR/977820
38 INPUT "DISTANCE (LY)";R
40 R=R/3.2616: REM  LY TO PARSECS
42 INPUT "MAGNITUDE";M0
44 X=R*COS(D)*COS(A)
46 Y=R*COS(D)*SIN(A)
48 Z=R*SIN(D)
50 DX=(X/R)*DR-Z*COS(A)*DD-Y*DA
52 DY=(Y/R)*DR-Z*SIN(A)*DD+X*DA
54 DZ=(Z/R)*DR+R*COS(D)*DD
56 REM
58 PRINT: REM   LOOP
60 INPUT "YEARS FROM PRESENT";T
62 X1=X+T*DX:Y1=Y+T*DY:Z1=Z+T*DZ
64 R1=SQR(X1*X1+Y1*Y1+Z1*Z1)
66 B=(R1/R)*(R1/R)
68 M1=M0+2.5*LOG(B)/LOG(10)
70 S5=Z1/R1: C5=SQR(1-S5*S5)
72 D1=ATN(S5/C5)*180/P1
74 A1=ATN(Y1/X1)*180/(P1*15)
76 IF X1<0 THEN A1=A1+12
78 IF A1>24 THEN A1=A1-24
80 IF A1<0 THEN A1=A1+24
82 PRINT "R.A. (HOURS) ";A1
84 PRINT "DEC. (DEGREES)";D1
86 PRINT "DISTANCE  ";R1*3.2616
88 PRINT "MAGNITUDE ";M1
90 PRINT
92 INPUT "AGAIN (Y OR N)";Q$
94 IF Q$<>"N" THEN 58 
96 END
100 REM  ************************
110 REM  THIS PROGRAM USES A STAR'S
120 REM  CURRENT POSITION, PROPER
130 REM  MOTION, DISTANCE, AND BRIGHT-
140 REM  NESS TO COMPUTE ITS PATH 
150 REM  ACROSS THE SKY IN THE REMOTE
160 REM  PAST OR FUTURE.  DESCRIBED IN
170 REM  SKY & TELESCOPE MAGAZINE FOR 
180 REM  MAY, 1989, PAGE 531.
190 REM  *************************
