Post by xxgeek on Apr 28, 2024 12:33:24 GMT
Latest Version with all the files - Here
'World Views' A fine piece of code developed by tenochtitlanuk
'Posted at - libertybasiccom.proboards.com/threads/recent/2558
Editted/Butchered to allow more user interaction, and to keep the kids busy.
Great little toy for visiting grand kids.
Any issues, let me know.
Download the support files Here
'World Views' A fine piece of code developed by tenochtitlanuk
'Posted at - libertybasiccom.proboards.com/threads/recent/2558
Editted/Butchered to allow more user interaction, and to keep the kids busy.
Great little toy for visiting grand kids.
Any issues, let me know.
Download the support files Here
'Original code 'World Views' by tenochtitlanuk
'Posted at - https://libertybasiccom.proboards.com/threads/recent/2558
'Adapted for User Interaction by xxgeek
'
'Use the OnScreen Arrow buttons to turn the globe in different directions
'Works best when [Outline] is OFF, but will work, just slower to draw.
'
'Set up your variables and click [New Creation] button. (as many times as you like)
'Use the [Make BMPs] button prior to Using the [Make Gifs] button
'You will need the BMP's to Make the GIF.s
'Making BMP's: As is - creates 180 .bmp files (possible future user control)
' Can take close to an hour when (OUTLINE) is checked
'A lot less time, but still subtantial, when [Fill Land] is checked
'
'The textboxes are variable too, so edit them and see what you get.
'Have fun, and let your kids play with it once in a while. Don't horde it. :D
'Thanks go to tenochtitlanuk for permission to use/distribute his code_
' _and hard earned data files
nomainwin
global fileOpen, pi, windowOpen
dim configs$(12)
dim glowAdjust$(300)
glowAdjust = 1
for n = 1 to 300
glowAdjust$(glowAdjust) = str$(n)
glowAdjust=glowAdjust + 1
next n
dim penSize$(100)
penSize = 1
for n = 1 to 100
penSize$(penSize) = str$(n)
penSize=penSize + 1
next n
dim glowDepth$(401)
glowDepth = 1
for n = 0 to 400
glowDepth$(glowDepth) = str$(n)
glowDepth=glowDepth + 1
next n
dim earthSize$(35)
esize=1
for n= 10 to 350 step 10
earthSize$(esize)=str$(n)
esize=esize+1
next n
dim color$(18)
color$(1)="Yellow"
color$(2)="Brown"
color$(3)="Red"
color$(4)="DarkRed"
color$(5)="Pink"
color$(6)="DarkPink"
color$(7)="Blue"
color$(8)="DarkBlue"
color$(9)="Green"
color$(10)="DarkGreen"
color$(11)="Cyan"
color$(12)="DarkCyan"
color$(13)="White"
color$(14)="Black"
color$(15)="LightGray"
color$(16)="DarkGray"
color$(17)="Buttonface"
bmpNum=1
glowAdjust=10
extraColor$="Darkred"
lastContinentsColor$ = "DarkGreen"
earthColor$ = "Blue"
planetGlowColor$ = "DarkBlue"
continentsColor$ = "DarkGreen"
bckGroundColor$ = "Black"
grid = 0
glowDepth = 200
penSize = 2
longitude = -360
fileOpen =0
outline = 0
fill=1
pi =3.14159265
' constants
E = 6378.0 ' Earth radius
K1 = 1.0
K2 = pi / 2 ' pi /2
K3 = pi ' pi
K6 = 2 * pi ' 2 pi
T = 0.00015 ' test value
Z = 0.0
'R = 250 ' map size in pixels /cm
CR$ =chr$( 13 )
R =250 ' size of screen globe
D = 3
WindowWidth =1200
WindowHeight = 720
UpperLeftX = (DisplayWidth-WindowWidth)/2
UpperLeftY = (DisplayHeight-WindowHeight)/2
ForegroundColor$ = "Buttonface"
BackgroundColor$ = "darkgray"
TextboxColor$ = "black"
textbox #w.tb1, 320, 62, 80, 25
textbox #w.tb2, 320, 87, 80, 25
textbox #w.tb3, 320, 112, 80, 25
textbox #w.tb4, 320, 137, 80, 25
textbox #w.tb5, 320, 235, 80, 25
statictext #w.st1, " A -latitude /degrees" +CR$_
+" H -height /m"_
+CR$ +" I -azimuth /degrees"_
+CR$ +" LO -longitude /degrees"_
+CR$ + "----------------------------"_
+ " 0 =perspective" +CR$_
+ " 1 =mod'd persp'ive" + CR$_
+ " 2 =azimuthal equidistant"_
+ CR$ + " 3 =polar equidistant" +CR$_
+ " 4 =ortho equatorial"_
+ CR$ + " 5 =Cartesian Lat /Lon", 9, 65, 300, 320
statictext #w.stazimuth, "Azimuth", 320, 170, 130, 20
bmpbutton #w.azleft, "lbttn.bmp", [azleft],ul, 325, 195
bmpbutton #w.azright, "rbttn.bmp", [azright],ul, 370, 195
ComboboxColor$="black"
combobox #w.glowAdjust,glowAdjust$(,[glowAdjust], 2, 2,120, 20
combobox #w.glowColor,color$(,[planetGlowColor], 123, 2,130, 20
combobox #w.extraColor,color$(,[extraColor], 256, 2, 140, 20
combobox #w.glowDepth,glowDepth$(,[glowDepth], 400, 2, 125, 20
combobox #w.penSize,penSize$(,[penSize], 530, 2, 110, 20
combobox #w.earthSize,earthSize$(,[earthSize], 645, 2, 130, 20
combobox #w.bakColor,color$(,[bakColor], 780, 2,130, 20
combobox #w.earthColor,color$(,[earthColor], 915, 2,145, 20
combobox #w.contColor,color$(,[contColor], 1065, 2,135, 20
statictext #w.stglowAdjust, " ";glowAdjust, 2, 36, 120, 20
statictext #w.stglowColor, planetGlowColor$, 122, 36, 130, 20
statictext #w.stextraColor, extraColor$, 256, 36, 130, 20
statictext #w.stglowDepth, glowDepth$, 400, 36, 120, 20
statictext #w.stpenSize, str$(penSize), 530, 36, 120, 20
statictext #w.stearthSize, str$(R), 645, 36, 120, 20
statictext #w.stbakColor, bckGroundColor$, 780, 36, 130, 20
statictext #w.stearthColor, earthColor$, 915, 36, 130, 20
statictext #w.stcontColor, continentsColor$, 1065, 36, 130, 20
graphicbox #w.gb, 420, 60, 770, 680
button #w.loadconfig "Load Config", [loadconfig], ul, 280, 275, 130, 30
button #w.saveconfig "Save Config", [saveconfig], ul, 280, 315, 130, 30
checkbox #w.grid, "Show Grid", [Grid],[noGrid],20, 355, 120, 25
checkbox #w.appear, "Fill Land", [fillCont], [noFill], 20, 325, 120, 20
checkbox #w.appear2, "Outline", [outlineLand], [noOutLine], 165, 325, 95, 20
bmpbutton #w.left, "lbttn.bmp", [left],ul, 310, 400
bmpbutton #w.right, "rbttn.bmp", [right],ul, 365, 400
statictext #w.stlatlon, "Lat / Lon", 300, 355, 130, 20
bmpbutton #w.up, "maxbx.bmp", [up],ul, 340, 380
bmpbutton #w.down, "minbx.bmp", [down],ul, 340, 425
button #w.b1 "New Creation", [dataShow], ul, 120, 440, 160, 65
button #w.b2 "Save SnapShot", [saveScr], ul, 120, 390, 160, 40
statictext #w.st2, "Create a Spinning Globe GIF", 20, 510, 390, 30
statictext #w.st3, "Step #1", 30, 555, 80, 20
statictext #w.st4, "Step #2", 30, 606, 80, 20
statictext #w.st5, "Step #3", 30, 653, 80, 20
statictext #w.st6, "(Optional)", 285, 607, 108, 20
button #w.b5 "Make BMP's", [makeSpinPics], ul, 120, 550, 160, 30
button #w.b6 "Show Spinning", [showSpinningGlobe], ul, 120, 600, 160, 30
button #w.b7 "Make GIF File", [makeGif], ul, 120, 650, 160, 30
button #w.b3, "&Help", [guide], ul, 30, 460, 50, 30
button #w.b4, "Quit", quit , ul, 320, 460, 55, 30
open "Spinning Globe" for window_popup as #w
#w "trapclose quit"
#w "font Courier_New 14 bold"
#w.gb "down ; fill black"
#w.stglowAdjust " ";glowAdjust
#w.stglowDepth " ";glowDepth
#w.stpenSize " ";penSize
#w.stearthSize " ";R
#w.glowAdjust "!Glow-Aid"
#w.extraColor "!ExtraColor"
#w.glowDepth "!GlowSize"
#w.penSize "!PenSize"
#w.earthSize "!GlobeSize"
#w.bakColor "!BackColor"
#w.glowColor "!GlowColor"
#w.contColor "!LandColor"
#w.earthColor "!EarthColor"
#w.appear "set"
#w.st2 "!font Courier_New 20 bold"
#w.tb1 "20"
#w.tb2 "1e8"
#w.tb3 "0"
#w.tb4 "-90"
#w.tb5 "0"
fln$ = "LatLon4.csv"
[dataShow]
call safeDraw
#w.tb1 "!contents? inA$": A = val( inA$ ) *pi /180: #w.tb1 inA$: if A > 90 or A < 0 -90 then wait
#w.tb2 "!contents? inH$": H = val( inH$ ): H2 = E * H: if H <0 then wait
#w.tb3 "!contents? inI$": I = val( inI$ ) *pi /180: #w.tb3 inI$: if I < 0 -360 or I > 360 then wait
#w.tb4 "!contents? inLO$": LO = val( inLO$ ) *pi /180: #w.tb4 inLO$: if LO > 180 or LO < 0 -180 then wait
#w.tb5 "!contents? inJ$": J = val( inJ$ ): if J <> int( J ) or J > 5 or J < 0 then wait
#w.gb "cls ; down ; fill ";bckGroundColor$;" ;backcolor ";earthColor$;" ; up ; goto 390 340 ; down"
#w.gb "circlefilled ";R
if glowDepth <> 0 then
#w.gb "size ";glowDepth
#w.gb "color ";planetGlowColor$;" ; circle ";R+glowAdjust'*(glowDepth)
end if
#w.gb "flush"
' A ( entered in +degrees) latitude above which we are viewing.
' LO ( longitude) and
' I ( azimuth) also entered in degrees to East and clockwise.
' all three internally converted to radians.
A1 = sin( A )
A2 = cos( A )
H2 = E + H
M = acs( E / H2 ) ' max possible angle from observer to outer visible ring
G = E * ( H2 - E * cos( M ) ) ' scaling factor
F = R / ( E * sin( M ) ) ' scaling factors for two cases
F1 = R / M
[drawOutline]
if outline = 1 then
call safeDraw
if penSize <> 0 then #w.gb "size ";penSize';" ; color ";continentsColor$
fln$ = "dataWc.csv"
open fln$ for input as #fIn
fileOpen =1
gridDrawing = 0
do
line input #fIn, g$ ' lat, lon
P =val( word$( g$, 1, ",")) * pi / 180
L =val( word$( g$, 2, ",")) * pi / 180
if J = 0 or J = 1 or J = 2 then gosub [doP1ot012]
if J = 3 then gosub [doPlot3]
if J = 4 then gosub [doPlot4]
if J = 5 then gosub [doPlot5]
scan
loop until eof( #fIn)
close #fIn
fileOpen =0
call safeDrawOff
end if
if fill = 1 then [drawFill] else call safeDrawOff
wait
[drawFill]
if fill = 1 then
#w.gb "size ";penSize
fln$ = "LatLon4.csv"
open fln$ for input as #fill
fileOpen =1
gridDrawing = 0
do
line input #fill, g$ ' lat, lon
P =val( word$( g$, 1, ",")) * pi / 180
L =val( word$( g$, 2, ",")) * pi / 180
if J = 0 or J = 1 or J = 2 then gosub [doP1ot012]
if J = 3 then gosub [doPlot3]
if J = 4 then gosub [doPlot4]
if J = 5 then gosub [doPlot5]
scan
loop until eof( #fill)
close #fill
fileOpen =0
end if
[grid]
if grid = 1 then gosub [drawGrid]
call safeDrawOff
#w.b1 "!setfocus"
if makeSpinPics=1 then [makeSpinPics]
wait
[saveScr]
#w.gb "getbmp scr 0 0 770 700"
filedialog "Choose a filename to save image as ", "*.bmp", fOut$
if fOut$ ="" then fOut$ = "Cancelled_SaveDialog" +str$( time$( "seconds" ) ) +".bmp"
bmpsave "scr", fOut$
wait
[makeSpinPics]
bmpNum=bmpNum+2
longitude=longitude+2
#w.gb "getbmp scr 0 0 770 700"
fOut$ = longitude+359;".bmp"
bmpsave "scr", fOut$
if longitude > 0 then
makeSpinPics = 0
Notice "Finished Making BMP's";chr$(13);"BMP files are ready to make a GIF file.";chr$(13);chr$(13);"Watch Your Globe Spin Now for a Couple of Spins"
goto [showSpinningGlobe]
end if
#w.tb4 longitude
makeSpinPics = 1
goto [dataShow]
wait
[showSpinningGlobe]
' = 180 .bmp picture files(higher 'step' number = quicker spin = less .bmp files)
if fileExists(DefaultDir$, "1.bmp") then
while counter < 3
for picName = 3 to 361 step 2
loadbmp "globeName", picName;".bmp"
#w.gb "drawbmp globeName 0 0"
unloadbmp "globeName"
#w.gb "delsegment picName globeName"
#w.gb " flush globeName"
next picName
counter = counter + 1
scan
wend
#w.gb " flush globeName"
#w.gb "down ; fill black"
counter =0
goto [dataShow]
else
notice "You MUST first create the BMP Files."
end if
wait
[makeGif]
if fileExists("C:\Program Files\GIMP 2\bin", "gimp-2.10.exe") then
run "C:\Program Files\GIMP 2\bin\gimp-2.10.exe"
else
notice chr$(13);chr$(13);"You need to 'Install Gimp' in order to make GIF files.";chr$(34);chr$(34);_
"It's Best to Allow Gimp Installer to Install Where it Wants To"
run "explorer https://www.gimp.org/downloads/"
end if
wait
[Grid]
grid = 1
wait
[noGrid]
grid=0
wait
[fillCont]
fill = 1
wait
[outlineLand]
outline=1
wait
[noOutLine]
outline = 0
wait
[clearFill]
fill = 0
wait
[extraColor]
#w.extraColor "contents? extraColor$"
ColorDialog extraColor$, Chosen$
extraColor$ = Chosen$
#w.stextraColor extraColor$
#w.extraColor "!ExtraColor"
wait
[planetGlowColor]
#w.glowColor "contents? planetGlowColor$"
ColorDialog planetGlowColor$, Chosen$
planetGlowColor$ = Chosen$
#w.stglowColor planetGlowColor$
#w.glowColor "!GlowColor"
wait
[glowDepth]
#w.glowDepth "contents? glowDepth$"
glowDepth=val(glowDepth$)
#w.glowDepth "!GlowSize"
#w.stglowDepth " ";glowDepth
wait
[earthSize]
#w.earthSize "contents? earthSize$"
R = val(earthSize$)
#w.earthSize "!GlobeSize"
#w.stearthSize " ";R
wait
[penSize]
#w.penSize "contents? penSize$"
penSize=val(penSize$)
#w.penSize "!PenSize"
#w.stpenSize " ";penSize
wait
[bakColor]
#w.bakColor "contents? bckGroundColor$"
ColorDialog bckGroundColor$, Chosen$
bckGroundColor$ = Chosen$
#w.stbakColor Chosen$
#w.bakColor "!BakColor"
wait
[earthColor]
#w.earthColor "contents? earthColor$"
ColorDialog earthColor$, Chosen$
earthColor$ = Chosen$
#w.stearthColor Chosen$
#w.earthColor "!EarthColor"
wait
[glowAdjust]
#w.glowAdjust "contents? Chosen$"
glowAdjust = val(Chosen$)
#w.stglowAdjust " ";glowAdjust
#w.glowAdjust "!Glow-Aid"
wait
[contColor]
#w.contColor "contents? continentsColor$"
ColorDialog continentsColor$, Chosen$
continentsColor$ = Chosen$
#w.stcontColor Chosen$
#w.contColor "!LandColor"
wait
[left]
call safeDraw
#w.tb4 "!contents? left$"
left=val(left$)+15
#w.tb4 left
goto [dataShow]
[right]
call safeDraw
#w.tb4 "!contents? right$"
right=val(right$)-15
#w.tb4 right
goto [dataShow]
[up]
call safeDraw
#w.tb1 "!contents? up$"
up=val(up$)+10
#w.tb1 up
goto [dataShow]
[down]
call safeDraw
#w.tb1 "!contents? down$"
down=val(down$)-10
#w.tb1 down
goto [dataShow]
[azleft]
call safeDraw
#w.tb3 "!contents? left$"
left=val(left$)+10
#w.tb3 down
goto [dataShow]
[azright]
call safeDraw
#w.tb3 "!contents? right$"
right=val(right$)-10
#w.tb3 right
goto [dataShow]
[loadconfig]
redim configs$(13)
filedialog "Open Config File ", "*.cfg", config$
open config$ for input as #1
while eof(#1) =0
cfg=cfg+1
line input #1, configs$(cfg)
wend
cfg=0
close #1
glowAdjust=val(configs$(1)):#w.stglowAdjust glowAdjust
planetGlowColor$=configs$(2):#w.stglowColor planetGlowColor$
extraColor$=configs$(3) :#w.stextraColor extraColor$
glowDepth=val(configs$(4)):#w.stglowDepth glowDepth
penSize=val(configs$(5)):#w.stpenSize penSize
R=val(configs$(6)):#w.stearthSize R
bckGroundColor$=configs$(7):#w.stbakColor bckGroundColor$
earthColor$=configs$(8):#w.stearthColor$ earthColor$
continentsColor$=configs$(9):#w.stcontColor continentsColor$
fill=val(configs$(10))
outline=val(configs$(11))
grid=val(configs$(12))
if fill =0 and outline =0 then fln$ = "LatLon4.csv"
if fill = 1 then fln$ = "LatLon4.csv"
if outline = 1 then fln$ = "dataWc.csv"
if fill=1 then #w.appear "set" else #w.appear "reset"
if outline = 1 then #w.appear2 "set" else #w.appear2 "reset"
if grid = 1 then #w.grid "set" else #w.grid "reset"
goto [dataShow]
wait
[saveconfig]
filedialog "Save as ", "*.cfg", config$
open config$ for output as #1
#1 glowAdjust
#1 planetGlowColor$
#1 extraColor$
#1 glowDepth
#1 penSize
#1 R
#1 bckGroundColor$
#1 earthColor$
#1 continentsColor$
#1 fill
#1 outline
#1 grid
close #1
wait
[doP1ot012]
scan
S = Z
L1 = L - LO
if L1 >= 0 -K3 then goto 3000
L1 = L1 + K6
goto 5500
3000
if L1 <= K3 then goto 4000
L1 = L1 - K6
4000
B1 = abs( L1)
if B1 > T then goto 4050
D = abs( A - P )
if D > M then goto 4300
D1 = sin( D )
D2 = cos( D )
C = Z
if P >= A then goto 5000
C = K3
goto 5000 ' ??? is this the correct target?
4050
if abs( K3 - B1 ) > T then goto 4250
D = K3 - A - P
if D > K3 then goto 4100
C = Z
goto 4200
4100
D = K6 - D
C = K3
4200
if D > M then goto 4300
D1 = sin( D)
D2 = cos( D)
goto 5000
4250
P1 = sin( P )
D2 = A1 * P1 + A2 * Cos( P ) * Cos( L1 )
D = acs( D2)
if D <= M then goto 4500
4300
S = K1
return
4500
D1 = sin( D )
C1 = ( P1 - A1 * D2 ) / ( A2 * D1 )
if C1 < 0 -K1 then goto 4300
if C1 > K1 then goto 4300
C = acs( C1)
if L1 >= Z then goto 5000
C = K6 - C
5000
if I = Z then goto 5500
C = C - I
if C >= Z then goto 5500
C = K6 + C
5500
C = K2 -C
5600 if C >= 0 -K3 then goto 6000
C = C + K6
6000
if J <> Z then goto 6500
R1 = F * ( G * D1 ) / ( H2 -E * D2 )
6250
goto 7000
6500
if J <> K1 then goto 6700
R1 = F * E * D1
6600
goto 7000
6700
R1 = F1 * D
7000
X = R1 * cos( C )
Y = R1 * sin( C )
'#w.gb "color white ; set "; 390 + int( X );" ";340 - int( Y )
#w.gb "color ";continentsColor$;" ; set "; 390 + int( X );" ";340 - int( Y )
if extraColor$ <> "" then #w.gb "color ";extraColor$;" ; set "; 389 + int( X ); " "; 342 - int( Y )
return
' _________________________________________________________________
[doPlot3] ' Map to polar equidistant coordinates
'H = 1 ' Northern hemisphere: = 1 for Southern hemisphere
if H = 0 then goto 7490
if P > 0.0 then goto 7500
L = 0 - L
goto 7540
7490 if P >= 0.0 then goto 7540
7500 S = 1
return
7540
F = 2 * R / pi
R1 = F * ( 1.5707963 - abs( P ))
X = R1 * cos( L )
Y = R1 * sin( L )
#w.gb "set "; 390 + int( X ); " "; 340 - int( Y )
#w.gb "color ";continentsColor$;" ; set "; 391 + int( X ); " "; 342 - int( Y )
if extraColor$ <> "" then #w.gb "color ";extraColor$;" ; set "; 392 + int( X ); " "; 351 - int( Y )
if extraColor$ <> "" then #w.gb "color ";extraColor$;" ; set "; 389 + int( X ); " "; 3419 - int( Y )
return
'_______________________________________________
[doPlot4]
' Map to ortho equatorial coordinates
'print P, L
scan
'R = 300
S = 0
L = L - LO
if L <= 3.14159265 then 9450
L = L - 6.2831853
goto 9490
9450
if L >= 0 - 3.14159265 then 9490
L = L + 6.2831853
9490
if L < 0 - 1.5707963 then 9510
if L <= 1.5707963 then 9550
9510
S = 1
return
9550
R1 = R * sin( 1.5707963 - abs( P ))
X = R1 * sin( L )
Y = R * sin( P )
#w.gb "color ";continentsColor$;" ; set "; 390 + int( X ); " "; 340 - int( Y )
if extraColor$ <> "" then #w.gb "color ";extraColor$;" ; set "; 391 + int( X ); " "; 341 - int( Y )
if extraColor$ <> "" then #w.gb "color ";extraColor$;" ; set "; 392 + int( X ); " "; 339 - int( Y )
return
' ______________________________________
[doPlot5]
#w.gb "color ";continentsColor$;" ; set "; 354 + int( 2.15 * L * 180 / pi ); " "; 340 - int( 1.6 * P * 180 / pi )
if extraColor$ <> "" then #w.gb "color ";extraColor$;" ; set "; 355 + int( 2.15 * L * 180 / pi ); " "; 341 - int( 1.6 * P * 180 / pi )
if extraColor$ <> "" then #w.gb "color ";extraColor$;" ; set "; 356 + int( 2.15 * L * 180 / pi ); " "; 339 - int( 1.6 * P * 180 / pi )
return
' ______________________________________
sub safeDraw
#w.tb1 "!disable"
#w.tb2 "!disable"
#w.tb3 "!disable"
#w.tb4 "!disable"
#w.tb5 "!disable"
#w.left "disable"
#w.right "disable"
#w.up "disable"
#w.down "disable"
#w.azleft "disable"
#w.azright "disable"
#w.glowAdjust "disable"
#w.extraColor "disable"
#w.glowDepth "disable"
#w.penSize "disable"
#w.earthSize "disable"
#w.bakColor "disable"
#w.glowColor "disable"
#w.contColor "disable"
#w.earthColor "disable"
#w.b1 "!disable"
#w.b2 "!disable"
#w.b3 "!disable"
#w.b5 "!disable"
#w.b6 "!disable"
#w.b7 "!disable"
#w.grid "disable"
#w.appear "disable"
#w.appear2 "disable"
end sub
sub safeDrawOff
#w.tb1 "!enable"
#w.tb2 "!enable"
#w.tb3 "!enable"
#w.tb4 "!enable"
#w.tb5 "!enable"
#w.left "enable"
#w.right "enable"
#w.up "enable"
#w.down "enable"
#w.azleft "enable"
#w.azright "enable"
#w.glowAdjust "enable"
#w.extraColor "enable"
#w.glowDepth "enable"
#w.penSize "enable"
#w.earthSize "enable"
#w.bakColor "enable"
#w.glowColor "enable"
#w.contColor "enable"
#w.earthColor "enable"
#w.b1 "!enable"
#w.b2 "!enable"
#w.b3 "!enable"
#w.b5 "!enable"
#w.b6 "!enable"
#w.b7 "!enable"
#w.grid "enable"
#w.appear "enable"
#w.appear2 "enable"
end sub
[guide]
WindowWidth =800
WindowHeight =800
open "Guidance and help" for text as #w2
windowOpen = 1
#w2 "!font Courier_New 12 bold"
open "help.txt" for input as #fIn2
txt$ = input$( #fIn2, lof( #fIn2 ))
close #fIn2
windowOpen = 1
#w2 txt$
wait
' ______________________________________
sub quit h$
if windowOpen = 1 then close #w2
if fileOpen = 1 then close #fIn
close #w
end
end sub
'_______________________________________________
'Verify file existence function
function fileExists(path$, filename$)
dim fileExistsInfo$(0,0)
files path$, filename$, fileExistsInfo$()
fileExists = val(fileExistsInfo$(0, 0)) 'non zero is true
end function
[drawGrid]
call safeDraw
#w.gb "size ";penSize
for long = -180 to 180 step 10
for lat = -90 to 90 step 0.75
L =long * pi / 180 ' both in radians
P =lat * pi / 180
if J = 0 or J = 1 or J = 2 then gosub [doP1ot012]
'calldll #kernel32, "Sleep", 100 as long, ret as void ' if want to watch slowly!
if J = 3 then gosub [doPlot3]
if J = 4 then gosub [doPlot4]
if J = 5 then gosub [doPlot5]
scan
next lat
next long
for long = -180 to 180 step 0.5
for lat = -90 to 90 step 10
L =long * pi / 180 ' both in radians
P =lat * pi / 180
if J = 0 or J = 1 or J = 2 then gosub [doP1ot012]
'calldll #kernel32, "Sleep", 100 as long, ret as void ' if want to watch slowly!
if J = 3 then gosub [doPlot3]
if J = 4 then gosub [doPlot4]
if J = 5 then gosub [doPlot5]
scan
next lat
next long
call safeDrawOff
return