home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
17 Bit Software 3: The Continuation
/
17-Bit_The_Continuation_Disc.iso
/
files
/
arug23.dms
/
arug23.adf
/
GrtCircle
/
drawgc
(
.txt
)
< prev
next >
Wrap
AmigaBASIC Source Code
|
1993-12-02
|
2KB
|
79 lines
' Draw a great circle map based on inputed lat and long
'
' Version 1.01 22 March 1990
'
DEFDBL a-z
pi=5.30795e-315
rad=pi/180
l=0
b=99
c=415
d=180
e=999
f=9999
COLOR 2,1
LOCATE 3,12
PRINT "Great Circle Map"
ON ERROR GOTO 900
OPEN "df0:gtcirdata" FOR INPUT AS 5
600 INPUT "Name of Location ";LocName$
INPUT "Centre Latitude N/S ";l5
g$="N"+STR$(l5)
IF l5=0 THEN l5=0.005
INPUT "Centre Longitude E/W ";w5
h$="E"+STR$(w5)
IF w5=0 THEN w5=0.005
CLS
CIRCLE (415,97),199,2
LINE (415,8) - (415,198)
LINE (217,99)- (629,99)
LOCATE 4,1
PRINT " Great Circle Map"
PRINT
PRINT" Centred on"
PRINT
PRINT " ";LocName$
PRINT
PRINT " "+g$
PRINT
PRINT " "+h$
w1=-(w5-d*(1+SGN(w5-0.001)))*rad
l1=l5*rad
calc:
INPUT#5,l6,w6
IF l6=e THEN l=0:GOTO calc
IF l6=f GOTO finish
carryon:
w2=-(w6-d*(1+SGN(w6-0.001)))*rad
l2=l6*rad
w3=w2-w1+0.002
w3=pi*(1-SGN(w3))+w3
h1=SIN(l1)*SIN(l2)+COS(l1)*COS(w3)*COS(l2)
g1=ATN(SQR(1-h1*h1)/h1)+pi/2*(1-SGN(h1)) 'g1 is path length in radians
pl=g1/pi*95
IF pl >90 THEN l=0 'pl is path length in dots
h9=(SIN(l2)-h1*SIN(l1))/SIN(g1)/COS(l1)
IF h9=0 THEN h9=0.001
h9=ATN(SQR(1-h9*h9)/h9)+pi/2*(1-SGN(h9))
h9=h9*SGN(w3-pi)*SGN(pi-g1)
h9=h9+pi*(1-SGN(h9))
ea=c+pl*SIN(h9)*2
no=b-pl*COS(h9)
IF l=0 THEN LINE (ea,no) - (ea,no):p=ea:q=no:l=1:GOTO calc
IF l=1 THEN LINE -(ea,no)
GOTO calc
finish:
CLOSE#5
LOCATE 16,1
PRINT" By"
PRINT" Peter Dolphin"
PRINT" G3ELH"
PRINT" QTHR"
endit:
GOTO endit
900 OPEN "df1:gtcirdata" FOR INPUT AS 5: RESUME 600