10 REM Create a waypoint file for Mission Planner 20 REM Define a rectangle with A(long,lat) and B(long,lat) 30 REM with A in the bottom left-hand corner, 40 REM and B in the upper right-hand corner 50 REM. Input A(lat,long) and B(lat,long) 60 wide=.000003448: REM in geo-units of 0.3484 inches = 12 in 70 input "A-latitude=";Alat 80 input "A-longitude=";Alon 90 input "B-latitude=";Blat 100 input "B-longitude=";Blon 110 if Alat > Blat then print " Alat > Blat !":GOTO 70 120 if Alon > Blon then print " Alon > Blon !":GOTO 70 130 span=Blon-Alon: if span<0 then print "span<0":GOTO 70 140 length=Blat-Alat:print "span=";span,"length=";length 150 REM. Create a text file for output 160 open "waypoints.txt" for output as #1 170 print #1,"QGC WPL 110":REM header, what does this mean? 180 print #1,0,1,0,16,0,0,0,0, 190 A=Alat:B=Alon:GOSUB 430 200 lnum=0:REM line number 210 np=int(span/wide)+1:inc=span/np: print "np=";np,"inc=";inc 220 for n=1 to np: lnum=lnum+1:REM bump line number 230 print #1,lnum,0,3,16,0,0,0,0, 240 A=Alat+length:B=Alon+inc*(n-1):GOSUB 430 250 lnum=lnum+1:REM bump line number 260 print #1,lnum,0,3,194,1,0,1,0,0,0,0,1:REM go rev 270 lnum=lnum+1:REM bump line number 280 print #1,lnum,0,3,16,0,0,0,0, 290 A=Alat:B=Alon+inc*n:GOSUB 430 300 lnum=lnum+1:REM bump line number 310 print #1,lnum,0,3,194,0,0,1,0,0,0,0,1:REM go fwd 320 next n: lnum=lnum+1 330 REM. one more pass to make 340 print #1,lnum,0,3,16,0,0,0,0, 350 A=Blat:B=Blon:GOSUB 430 360 lnum=lnum+1:REM bump line number 370 print #1,lnum,0,3,194,1,0,1,0,0,0,0,1:REM go rev 380 lnum=lnum+1:REM bump line number 390 print #1,lnum,0,3,16,0,0,0,0, 400 A=Alat:B=Blon:GOSUB 430 410 close #1 420 end 430 REM. Get all the sig figs out 440 print #1,using "###.########";A,B, 450 print #1,0,1 460 return