gps.open
cls
pause 700
print"Calibrating"
a:
gps.accuracy acs
if  acs<7
 goto b
endif
b:
array.load menu$[],"Mark",~
 "Show me","Exit"
menu:
select m,menu$[],msg$
 
if m =1
  gosub mark
endif
if m=2 
  gosub show
endif
if m=3
  goto ends
end if


goto menu


show:
! gps.open
cls
print "showing"
pause 2000
gps.accuracy acc
if acc<13
  print lats,lons,acc
 gps.longitude lons
 gps.latitude lats
 gosub findd
 print"found d"
 pause 3000
endif
return

findd:
lond=(lonm+lons)/2
latd=(latm+lats)/2
latm= toradians(latm)
lonm= toradians(lonm)
lats= toradians(lats)
lons= toradians(lons) 

r=6371
d=acos(sin(latm)*sin(lats)+~
cos(latm)*cos(lats)*cos(dlon))*r

Print d,"KM"
pause 5000

d=0
return


mark:

menu$[2]="Show me"
pause 2000
mrk1:
latlong$=""
gps.accuracy acc
cls 
print acc
 if acc <13
  accm=acc
  goto mrk2
 endif
goto mrk1
mrk2:

gps.latitude latm
gps.longitude lonm
latlong$="lat:"+str$(latm)+~
" long:"+str$(lonm)
menu$[2]=menu$[2]+~
"                                             "+~
latlong$



return


ends:
