Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-01 - decus/20-0025/sphere.bas
There are 2 other files named sphere.bas in the archive. Click here to see a list.
00010	GO TO 432
00100	DATA 1E37
00102	PRINT
00104	PRINT"   S P H E R I C A L   T R I A N G L E   S O L U T I O N"
00106	PRINT
00108	PRINT
00110	LET L = 0
00112	LET P=3.1415926
00114	LET C = 180/P
00116	READ D0
00118	IF D0=1E37 THEN 476
00120	READ M0, T0, N0, D1, M1, T1, N1, H0, J0
00122	LET L = L+1
00124	PRINT"CASE NUMBER";L
00126	PRINT
00128	PRINT
00130	PRINT"LOCAL POSITION:"
00132	PRINT
00134	PRINT ABS(D0);"DEG   ";M0;"MIN  ";
00136	IF D0 < 0 THEN 142
00138	PRINT"NORTH ";
00140	GOTO 144
00142	PRINT"SOUTH ";
00144	PRINT"LATITUDE"
00146	PRINT ABS(T0);"DEG   ";N0;"MIN  ";
00148	IF T0 < 0 THEN 154
00150	PRINT"WEST ";
00152	GOTO 156
00154	PRINT"EAST ";
00156	PRINT"LONGITUDE"
00158	PRINT
00160	PRINT
00162	PRINT"REMOTE POSITION:"
00164	PRINT
00166	PRINT ABS(D1);"DEG   ";M1;"MIN  ";
00168	IF D1 < 0 THEN 174
00170	PRINT"NORTH ";
00172	GOTO 176
00174	PRINT"SOUTH ";
00176	PRINT"LATITUDE"
00178	PRINT ABS(T1);"DEG   ";N1;"MIN  ";
00180	IF T1 < 0 THEN 186
00182	PRINT"WEST ";
00184	GOTO 188
00186	PRINT"EAST ";
00188	PRINT"LONGITUDE"
00190	PRINT
00192	PRINT
00194	LET M0 = M0/60
00196	LET N0 = N0/60
00198	LET M1 = M1/60
00200	LET N1 = N1/60
00202	IF D0 >= 0 THEN 208
00204	LET D0 = (ABS(D0)+M0+90)/C
00206	GOTO 210
00208	LET D0 = (90-(D0+M0))/C
00210	IF D1 >= 0 THEN 216
00212	LET D1 = (ABS(D1)+M1+90)/C
00214	GOTO 218
00216	LET D1 = (90-(D1+M1))/C
00218	IF T0 >= 0 THEN 224
00220	LET T0 = -(ABS(T0)+N0)/C
00222	GOTO 226
00224	LET T0 = (T0+N0)/C
00226	IF T1 >= 0 THEN 232
00228	LET T1 = -(ABS(T1)+N1)/C
00230	GOTO 234
00232	LET T1 = (T1+N1)/C
00234	LET T = ABS(T1-T0)
00236	LET F = COS(D0)*COS(D1)+SIN(D0)*SIN(D1)*COS(T)
00238	LET F1 = SQR(ABS(1-F^2))
00240	LET Z = ATN(ABS(F1/F))
00242	IF F >= 0 THEN 246
00244	LET Z = P-Z
00246	LET G = (COS(D1)-F*COS(D0))/(F1*SIN(D0))
00248	LET B0 = ATN(ABS(SQR(ABS(1-G^2))/G))
00250	IF G >= 0 THEN 254
00252	LET B0 = P-B0
00254	IF (T0-T1) >= 0 THEN 258
00256	LET B0 = 2*P-B0
00258	LET H = (COS(D0)-F*COS(D1))/(F1*SIN(D1))
00260	LET B1 = ATN(ABS(SQR(ABS(1-H^2))/H))
00262	IF H >= 0 THEN 266
00264	LET B1 = P-B1
00266	IF (T1-T0) >= 0 THEN 270
00268	LET B1 = 2*P-B1
00270	PRINT"LOCAL HOUR ANGLE (AT NORTH POLE):"
00272	PRINT
00274	PRINTINT(10*T*C+.5)/10;"DEG"
00276	PRINT INT(T*C);"DEG   ";
00278	PRINT INT(600*(T*C-INT(T*C))+.5)/10;"MIN"
00280	LET H7 = T*C/15
00282	LET M7 = (H7-INT(H7))*60
00284	LET S7 = (M7-INT(M7))*60
00286	PRINT INT(H7);"HRS   ";INT(M7);"MIN   ";INT(10*S7+.5)/10;"SEC"
00288	PRINT
00290	PRINT
00292	PRINT"ZENITH (GREAT CIRCLE) DISTANCES:"
00294	PRINT
00296	PRINT INT(10*Z*C+.5)/10;"DEG"
00298	PRINT INT(Z*C);"DEG   ";
00300	PRINT INT(600*(Z*C-INT(Z*C))+.5)/10;"MIN"
00302	PRINT INT(600*Z*C+.5)/10;"NAUTICAL MILES"
00304	PRINT INT(600*Z*C*6080.2/5280+.5)/10;" STATUTE MILES"
00306	PRINT
00308	PRINT
00310	PRINT"TRUE BEARINGS (GREAT CIRCLE COURSES):"
00312	PRINT
00314	PRINT" REMOTE POSITION FROM LOCAL POSITION:"
00316	PRINT INT(10*B0*C+.5)/10;"DEG"
00318	PRINT INT(B0*C);"DEG   ";INT(600*(B0*C-INT(B0*C))+.5)/10;"MIN"
00320	PRINT
00322	PRINT" LOCAL POSITION FROM REMOTE POSITION:"
00324	PRINT INT(10*B1*C+.5)/10;"DEG"
00326	PRINT INT(B1*C);"DEG   ";INT(600*(B1*C-INT(B1*C))+.5)/10;"MIN"
00328	PRINT
00330	PRINT
00332	PRINT"ALTITUDE (REMOTE CELESTIAL POSITION"
00334	PRINT"   ABOVE LOCAL POSITION HORIZON):"
00336	PRINT
00338	LET A7 = 90-Z*C
00340	LET A8 = ABS(A7)
00342	IF A7 < 0 THEN 348
00344	PRINT INT(10*A7+.5)/10;
00346	GOTO 350
00348	PRINT -1*INT(10*A8+.5)/10;
00350	PRINT"DEG"
00352	IF A7 < 0 THEN 360
00354	PRINT INT(A7);"DEG   ";
00356	PRINT INT(600*(A7-INT(A7))+.5)/10;"MIN"
00358	GOTO 364
00360	PRINT -1*INT(A8);"DEG   ";
00362	PRINT INT(600*(A8-INT(A8))+.5)/10;"MIN"
00364	PRINT
00366	PRINT
00368	IF (1+H0)*(1+J0) = 1 THEN 418
00370	PRINT"OBSERVED ALTITUDE:"
00372	PRINT
00374	PRINT H0;"DEG   ";J0;"MIN"
00376	LET H1 = H0 + J0/60
00378	PRINT INT(100*H1+.5)/100;"DEG"
00380	PRINT
00382	PRINT
00384	PRINT"LINE OF POSITION:"
00386	PRINT
00388	LET I4 = 60*(H1-A7)
00390	PRINT INT(10*ABS(I4)+.5)/10;"MILES ";
00392	IF I4 > 0 THEN 398
00394	PRINT"AWAY ";
00396	GOTO 400
00398	PRINT"TOWARDS ";
00400	PRINT"ON LINE BEARING  ";
00402	IF I4 > 0 THEN 416
00404	LET B9 = B0*C+180
00406	IF B9 > 360 THEN 412
00408	PRINT INT(10*B9+.5)/10;"DEGREES TRUE"
00410	GOTO 418
00412	LET B9 = B9-360
00414	GOTO 408
00416	PRINT INT(10*B0*C+.5)/10;"DEGREES TRUE"
00418	PRINT
00420	PRINT
00422	PRINT
00424	PRINT
00426	PRINT
00428	PRINT
00430	GOTO 116
00432	PRINT
00434	PRINT"      THE 'SPHERE' PROGRAM SOLVES SPHERICAL TRIANGLES HAVING"
00436	PRINT"THE APEX AT THE NORTH POLE AND THE OTHER TWO CORNERS DEFINED"
00438	PRINT"BY THEIR RESPECTIVE LATITUDES AND LONGITUDES.  DATA FOR AS"
00440	PRINT"MANY CASES AS DESIRED MAY BE ENTERED SUCCESSIVELY IN DATA"
00442	PRINT"STATEMENTS 10-99 IN THE FOLLOWING FORMAT:"
00444	PRINT
00446	PRINT"   10 DATA  LTD,LTM, LGD,LGM, RLTD,RLTM, RLGD,RLGM, ALD,ALM"
00448	PRINT
00450	PRINT"WHERE EACH PAIR OF NUMBERS SPECIFIES A LOCATION IN THE FORM"
00452	PRINT"'DEGREES,MINUTES' AS FOLLOWS:"
00454	PRINT
00456	PRINT"   LTD,LTM    = LOCAL LATITUDE"
00458	PRINT"   LGD,LGM    = LOCAL LONGITUDE"
00460	PRINT"   RLTD,RLTM  = REMOTE LATITUDE"
00462	PRINT"   RLGD,RLGM  = REMOTE LONGITUDE"
00464	PRINT"   ALD,ALM    = OBSERVED ALTITUDE (IF ANY)"
00466	PRINT
00468	PRINT"          FOR SOUTH LATITUDES AND EAST LONGITUDES, ENTER"
00470	PRINT "THE DEGREE VALUES AS NEGATIVE NUMBERS AND THE MINUTE"
00471	PRINT "VALUES AS POSITIVE NUMBERS.  IF THERE IS NO OBSERVED"
00472	PRINT "ALTITUDE, SET ALD AND ALM EQUAL TO ZERO."
00474	PRINT
00476	END