_Title ("3D Earth Moon Model") 'By OldsCool (Dave Baty) 3-14-19

Option Base 0: swidth = _Width(_ScreenImage): sheight = _Height(_ScreenImage)
Screen _NewImage(swidth, sheight, 32): _FullScreen , _Smooth: _PrintMode _KeepBackground: _MouseShow "CROSSHAIR"
Print "Loading Map Projections..."

Dim depth(529, 1) 'STORESS CALCULATED SORT VALUES FOR _MAPTRIANGLES (BACK TO FRONT) for the earth and space background model
Dim mdepth(528, 1) 'STORES CALCULATED SORT VALUES FOR _MAPTRIANGLES (BACK TO FRONT) for the moon model
Dim mapcoordinate(529, 3, 1) 'elements 1 to 3  = holds the CONSTANT X,Y values for each poly on the map projection imagee,  used by the _maptriangle routines (X value = (n,n,0) / Y value = (n,n,1)
Dim tripoint(529, 3, 1) 'elements 1 to 3  = holds latitude/Longitude values for each poly point
Dim dtoxy(529, 3, 1) 'stores the CALCULATED physical 2D x,y,screen coordinates for each poly for the earth and space background- element 529 stores the moon's physical x,y screen values
Dim mtoxy(528, 3, 1) 'stores the CALCULATED physical 2D x,y,screen coordinates for each poly for the moon

'** VARIABLE VALUES ALTERED BY PROGRAM & USER INPUT **
xrot = 0: yrot = 2: zrot = 0 'Startup Rotation Angles for the sphere
posize = 5 ' Percent of Size - scales the earth and moon only
zobs = 100000 ' MAIN Z-Perspective-Observation for the earth and moon  !! zobs controls the perspective of how close an object looks the closer you get to it (use low values and see weird effects)
mrotmode = 3: rm$(1) = " (Auto Rotate)": rm$(2) = " (x,y,z)": rm$(3) = " (Free style)" 'ROTATION MODE-METHOD USING THE LEFT-RIGHT MOUSE BUTTONS (mrotmode 1 = AUTO rotate / motmode 2 = individual X,Y,Z / mrotmode 3 = FREE rotate)"
modelaspect = 1.0: e_expand = 1.0: m_expand = 1.0 'model aspect controls the horizontal roundness /  e_expand exaggerates the earths size without actually shanging its scale  /  m_expand does same as e_expand but for the moon
info = -1: rinfo = -1 'program toggle switches, checked each second

'** CONSTANTS **
qx = Int(swidth * .5): qy = Int(sheight * .5) 'MODELS X/Y CENTER on the PHYSICAL screen / CENTER OF 'MODEL' SCREEN IS 0,0
xautorot = 1.2: yautorot = 2.3: zautorot = 1 'values for auto rotate mode  PRESS [R] to toggle
mtransparent = 255: wtransparent = 100 'ADJUSTABLE ALPHA TRANSPARENCYS FOR THE MOON & EARTH WATER  (0=transparent to 255=Opaque)
sradius = 1800 'SPACE MODEL RADIUS (BACKGROUND STARS)
szobs = 200000 'Z-Perspective-Observation for the SPACE background only ,!! zobs controls the perspective of how close an object looks the closer you get to it (adjust the number to low values and see weird effects)
eradius = 3958.75 'EARTH'S RADIUS (Earth Diameter = 7,917.5 mi)
mradius = 1079.5 'MOON'S RADIUS (Moon Diameter = 2,159 mi AND THE Moon is 27.268% the size of earth)
moonorbitcenter = 238900 'average DISTANCE from earth to the moon 238,900 miles +/-)
xobs = 0: yobs = 0 '** CURRENTLY NOT USE AND SET AT ZERO. when used it allows you change then VIEWING PERSPECTIVE ANGLES of the model without actually altering the X,Y,Z rotation values...XOBS=VIEWING PERSPECTIVE LEFT,RIGHT OF CENTER / YOBS=VIEWING PERSPECTIVE ABOVE,BELOW CENTER
cf# = 6.28318530718 / 360 'Pi*2 divided by 360 degrees

'** OPEN IMAGES FOR SPACE BACKGROUND, EARTH AND MOON & SET TRANSPARENCIES FOR ALL
'** THE LOADED IMAGES BELOW ARE ALL POLAR-COMPRESSED 24 SECTION MAP CONVERSIONS, THEY WERE CREATED FROM FLAT EQUIRECTANGULAR IMAGES FOR SPACE, EARTH AND MOON. (UNCONVERTED EXAMPLES ARE INCLUDED IN THE DOWNLOAD)
'** I CODED A CONVERSION PROGRAM THAT LOADS THE EQUIRECTANGULAR IMAGES AND MAKES A 24 SECTION 'MASK' THEN PROCESSES/COMPRESSES EACH OF THE 24 SECTIONS AND PRODUCES THE OUTPUT FILES THAT ARE LOADED BELOW. !! THE CONVERSION PROGRAM IS NOT INTEGRATED INTO THIS EXAMPLE BUT I WILL PROVIDE IF REQUESTED !!
earthmap& = _LoadImage("Earth Projection24.jpg"): _SetAlpha wtransparent, _RGB32(0, 0, 0) To _RGB32(5, 14, 30), earthmap& '** OPEN 24 SECTION EARTH MAP TEXTURE AND SET WATER TRANSPARANCY(if you alter or replace the provided earth projectiom you should alter these RGB values).
moon& = _LoadImage("Moon Projection24.jpg"): _SetAlpha mtransparent, , moon& '                                             ** OPEN 24 SECION MOON MAP TEXTURE
space& = _LoadImage("space Projection24.jpg"): ' _DontBlend space& '                                                         ** OPEN 24 SECTION SPACE BACKGROUND MAP TEXTURE - MAKE SOLID ALPHA255

'*** READ BASE PIXEL X.Y COORDINATES FOR USE WITH THE EARTH MAP -AND- 3D MODEL LAT/LONG DATA FOR THE _MAPTRIANGLE SPHERE OF EARTH (moon model shares this data)
'the data READ supports a 24 section, 528 Poly, sphere model. it includes the physical x,y coordinates for the images and the spheres maptriange x,y,z values
For trianglecount = 1 To 529 'ELEMENT #529 CONTAINS VALUES FOR THE MOONS CENTER POINT LOCKED ONTO THE EARTHS ORBIT (ALSO HOLDS MOON'S ORBIT DISTANCE (DEPTH))
    Read mapcoordinate(trianglecount, 1, 0), mapcoordinate(trianglecount, 1, 1), tripoint(trianglecount, 1, 0), tripoint(trianglecount, 1, 1), mapcoordinate(trianglecount, 2, 0), mapcoordinate(trianglecount, 2, 1), tripoint(trianglecount, 2, 0), tripoint(trianglecount, 2, 1), mapcoordinate(trianglecount, 3, 0), mapcoordinate(trianglecount, 3, 1), tripoint(trianglecount, 3, 0), tripoint(trianglecount, 3, 1)
Next trianglecount

On Timer(1) GoSub fps: Timer On 'SET FRAMES PER SECOND TIMER
_Dest 0

'***********************************************************************
'========================= MAIN LOOP ============================
MainLoop:

mousecheck:
vermove = 0: hormove = 0: bigmove = 0: mb1 = 0: mb2 = 0: mb3 = 0
If Not _MouseInput Then GoTo controls
mdlx = _MouseX: mdly = _MouseY: vermove = _MouseMovementY: hormove = _MouseMovementX
mb1 = _MouseButton(1): mb2 = _MouseButton(2): mb3 = _MouseButton(3)
While _MouseInput: Wend
If Abs(hormove) > Abs(vermove) Then bigmove = hormove Else bigmove = vermove

controls:
mspeed = Abs(bigmove) * ((100 - posize) * .001) + (posize * .01): tempspeed = mspeed 'Controls the speed of the model rotation

If _KeyDown(27) Then System 'duh !
If (_KeyDown(82) Or _KeyDown(114)) Then rflag = 1 'toggle rotate mode, press R
If _KeyDown(87) Or _KeyDown(119) And adjust_moon = 0 Then adjust_water = 1: Else adjust_water = 0 'press [W] and hold - flag to adjust water transparency
If _KeyDown(77) Or _KeyDown(109) And adjust_water = 0 Then adjust_moon = 1: Else adjust_moon = 0 'press [W] and hold - flag to adjust water transparency
If _KeyDown(32) And iflag = 0 Then iflag = 1 'toggle show-info view, press spacebar
If _KeyDown(20480) Then mspeed = tempspeed * .1 'DOWN ARROW - SLOWS THE ROTATION WHILE USING THE MOUSE TO MOVE
If _KeyDown(18432) Then mspeed = tempspeed * 10 'UP AROW - SPEEDS THE ROATATION WHILE USING THE MOUSE TO MOVE
If mb1 = -1 And _KeyDown(100303) Then modelaspect = modelaspect + (bigmove * mspeed): mb1 = 0: If modelaspect <= .1 Then modelaspect = .1: Else If modelaspect > 10 Then modelaspect = 10 'HOLD right [Shift] key while pressing left mouse button and slide the mouse up/down to change Model aspect
If mb1 = -1 And _KeyDown(100304) Then e_expand = e_expand + (bigmove * mspeed): mb1 = 0: If e_expand < 1 Then e_expand = 1: Else If e_expand > 10000 Then e_expand = 10000 'HOLD left [Shift] key while pressing left mouse button and slide the mouse up/down to exaggerate the EARTH model
If mb1 = -1 And _KeyDown(100306) Then m_expand = m_expand + (bigmove * mspeed): mb1 = 0: If m_expand < 1 Then m_expand = 1: Else If m_expand > 10000 Then m_expand = 10000 'HOLD left [Ctrl] key while pressing left mouse button and slide the mouse up/down to exaggerate the MOON model
If mb1 = -1 And _KeyDown(100305) Then zobs = zobs + (bigmove * 10): mb1 = 0: If zobs < 1 Then zobs = 1: Else If zobs > 100000 Then zobs = 100000 'HOLD right [Ctrl] key while pressing left mouse button and slide the mouse up/down to change the Z-perspective value (very low values alter reality)

resize:
If mb3 Then posize = posize + (bigmove * mspeed): If posize <= .001 Then posize = .001 'PRESS AND HOLD THE MOUSE WHEEL AND MOVE THE MOUSE UP/DOWN TO SCALE THE EARTH AND MOON MODELS (not the same as using the exaggerate feature)

rotate:
If rinfo = 1 Then rinfo = -1: rflag = 0: mrotmode = mrotmode + 1: If mrotmode = 4 Then mrotmode = 1 ' change rotate mode (press (r/R)
If adjust_water = 1 Or adjust_moon = 1 Then GoTo checkit
On mrotmode GOTO auto, xyz, freespin
auto:
bigmove = 0: mspeed = .1: xrot = xrot + (xautorot * mspeed): yrot = yrot + (yautorot * mspeed): zrot = zrot + (zautorot * mspeed): GoTo checkit 'use predefined auto rotate values
xyz:
If mb1 = -1 And mb2 = 0 Then xrot = xrot + (bigmove * mspeed): GoTo checkit 'change X-rotation only
If mb2 = -1 And mb1 = 0 Then yrot = yrot + (bigmove * mspeed): GoTo checkit 'change Y-rotation only
If mb1 = -1 And mb2 = -1 Then zrot = zrot + (bigmove * mspeed) 'change Z-rotation only
GoTo checkit
freespin:
If mb1 = -1 And mb2 = -1 Then zrot = zrot + bigmove * mspeed: GoTo checkit 'change Z-rotation
If mb1 = -1 Then xrot = xrot + (vermove * mspeed): yrot = yrot - (hormove * mspeed) 'change X-rotation and Y-rotation using the left mouse button
If mb2 = -1 Then xrot = xrot - (vermove * mspeed): yrot = yrot + (hormove * mspeed) 'change X-rotation and Y-rotation using the right mouse button (moves inverse of left mouse)
checkit: 'chesk rotation values
If xrot >= 360 Then xrot = xrot - 360 Else If xrot < 0 Then xrot = 360 + xrot
If yrot >= 360 Then yrot = yrot - 360 Else If yrot < 0 Then yrot = 360 + yrot
If zrot >= 360 Then zrot = zrot - 360 Else If zrot < 0 Then zrot = 360 + zrot

rtt = posize * .01

'***** calculate space background **** THIS IS CONSTANT AND SEPARATE FROM THE EARTH MOON MODEL SCALING ****************
cz = Cos(cf# * zrot): SZ = Sin(cf# * zrot) 'controls z-rotation for the entire model (space, earth, moon)
cx = Cos(cf# * xrot + Atn(yobs / szobs)): sx = Sin(cf# * xrot + Atn(yobs / szobs))
cy = Cos(cf# * yrot + Atn(xobs / szobs)): sy = Sin(cf# * yrot + Atn(xobs / szobs))
For tri = 1 To 528
    For convert = 1 To 3 'three points for each poly
        I = cf# * tripoint(tri, convert, 0): j = cf# * tripoint(tri, convert, 1): r = sradius: a = r * Sin(I) * Sin(j): b = r * Cos(j): c = r * Cos(I) * Sin(j)
        a1 = a * cy - c * sy: c1 = a * sy + c * cy: b2 = b * cx - c1 * sx: c2 = b * sx + c1 * cx: A3 = a1 * cz - b2 * SZ: b3 = a1 * SZ + b2 * cz
        dr = c2 / (szobs - c2) + 1 'Distance ratio for computing perspective
        dtoxy(tri, convert, 0) = Int(A3 * dr + qx): dtoxy(tri, convert, 1) = Int(b3 * -dr + qy) 'contains the physical 2D screen x,y coordinates for 3D points
        If Abs(dtoxy(tri, convert, 0)) < 16384 Then GoTo checks
        If dtoxy(tri, convert, 0) < 0 Then dtoxy(tri, convert, 0) = -16383 Else dtoxy(tri, convert, 0) = 16383 'set max limit for 'x' screen coordinates that are too large
        checks:
        If Abs(dtoxy(tri, convert, 1)) < 16384 Then GoTo donechecks
        If dtoxy(tri, convert, 1) < 0 Then dtoxy(tri, convert, 1) = -16383 Else dtoxy(tri, convert, 1) = 16383 'set max limit for 'y' screen coordinates that are too large
        donechecks:
        cdepth(convert) = c2 'c2 represents the DEPTH/DISTANCE AWAY FROM CENTER for each of the three points of a poly
    Next convert
    clow = cdepth(1): If cdepth(2) < clow Then clow = cdepth(2)
    If cdepth(3) < clow Then clow = cdepth(3)
    depth(tri, 0) = clow: depth(tri, 1) = tri '** each of the 3 poly points has a 'depth' within the sphere model, clow records which of the three points is the farthest away, when sorted it allows the models to be rendered from back to front !!VERY IMPORTANT!!
Next tri
start = 1: finish = 528: Call QuickSort(start, finish, depth()) 'SORT ALL POLY POINTS FROM BACK TO FRONT
'RENDER THE 3D SPACE MODEL ordered back to front, show only the polys on the back side of the sphere
For eloop = 1 To 264: thedot = depth(eloop, 1) 'show only some of the background triangles of the space sphere (not the entire 528)
    _MapTriangle _Seamless(mapcoordinate(thedot, 1, 0), mapcoordinate(thedot, 1, 1))-(mapcoordinate(thedot, 2, 0), mapcoordinate(thedot, 2, 1))-(mapcoordinate(thedot, 3, 0), mapcoordinate(thedot, 3, 1)), space& To(dtoxy(thedot, 1, 0), dtoxy(thedot, 1, 1))-(dtoxy(thedot, 2, 0), dtoxy(thedot, 2, 1))-(dtoxy(thedot, 3, 0), dtoxy(thedot, 3, 1)), , _Smooth
Next eloop

'************************************************
'CALCULATE EARTH & MOON ROTATION VALUES
cx = Cos(cf# * xrot + Atn(yobs / zobs)): sx = Sin(cf# * xrot + Atn(yobs / zobs))
cy = Cos(cf# * yrot + Atn(xobs / zobs)): sy = Sin(cf# * yrot + Atn(xobs / zobs))
'***** calculate earth values *******************
For tri = 1 To 529: r = eradius * rtt: te_expand = e_expand
    If tri = 529 Then r = moonorbitcenter * rtt: te_expand = 1 'element 529 is the CENTER POINT FOR THE MOON SPHERE (te_expand stops the moon's center coordinate from growing when using the EXAGGERATE option)
    For convert = 1 To 3
        I = cf# * tripoint(tri, convert, 0): j = cf# * tripoint(tri, convert, 1): a = r * Sin(I) * Sin(j): b = r * Cos(j): c = r * Cos(I) * Sin(j)
        a1 = a * cy - c * sy: c1 = a * sy + c * cy: b2 = b * cx - c1 * sx: c2 = b * sx + c1 * cx: A3 = a1 * cz - b2 * SZ: b3 = a1 * SZ + b2 * cz
        dr = c2 / (zobs - c2) + 1 'Distance ratio for computing perspective
        dtoxy(tri, convert, 0) = Int(A3 * dr * modelaspect * te_expand + qx): dtoxy(tri, convert, 1) = Int(b3 * -dr * te_expand + qy)
        If Abs(dtoxy(tri, convert, 0)) < 16384 Then GoTo checky
        If dtoxy(tri, convert, 0) < 0 Then dtoxy(tri, convert, 0) = -16383 Else dtoxy(tri, convert, 0) = 16383
        checky:
        If Abs(dtoxy(tri, convert, 1)) < 16384 Then GoTo donecheck
        If dtoxy(tri, convert, 1) < 0 Then dtoxy(tri, convert, 1) = -16383 Else dtoxy(tri, convert, 1) = 16383
        donecheck:
        cdepth(convert) = c2
    Next convert
    clow = cdepth(1): If cdepth(2) < clow Then clow = cdepth(2)
    If cdepth(3) < clow Then clow = cdepth(3)
    depth(tri, 0) = clow: depth(tri, 1) = tri
Next tri
morbitdepth = depth(529, 0)
moonsizeperspective = (morbitdepth / (moonorbitcenter * rtt)) 'Moon's size perspective, looks smaller the farter away it is,  produces a value from -1 to 1 representing the moon's orbit depth
start = 1: finish = 529: Call QuickSort(start, finish, depth()) 'SORT ALL POLY POINTS FROM BACK TO FRONT

'***** calculate moon values **************
mqx = dtoxy(529, 1, 0): mqy = dtoxy(529, 1, 1) 'moon center point calculated from earth model element #529
For tri = 1 To 528: r = (mradius * rtt) + (moonsizeperspective * posize)
    For convert = 1 To 3
        I = cf# * tripoint(tri, convert, 0): j = cf# * tripoint(tri, convert, 1): a = r * Sin(I) * Sin(j): b = r * Cos(j): c = r * Cos(I) * Sin(j)
        a1 = a * cy - c * sy: c1 = a * sy + c * cy: b2 = b * cx - c1 * sx: c2 = b * sx + c1 * cx: A3 = a1 * cz - b2 * SZ: b3 = a1 * SZ + b2 * cz
        dr = c2 / (zobs - c2) + 1 'Distance ratio for computing perspective
        mtoxy(tri, convert, 0) = Int(A3 * dr * modelaspect * m_expand + mqx): mtoxy(tri, convert, 1) = Int(b3 * -dr * m_expand + mqy)
        If Abs(mtoxy(tri, convert, 0)) < 16384 Then GoTo mchecky
        If mtoxy(tri, convert, 0) < 0 Then mtoxy(tri, convert, 0) = -16383 Else mtoxy(tri, convert, 0) = 16383
        mchecky:
        If Abs(mtoxy(tri, convert, 1)) < 16384 Then GoTo mdonecheck
        If mtoxy(tri, convert, 1) < 0 Then mtoxy(tri, convert, 1) = -16383 Else mtoxy(tri, convert, 1) = 16383
        mdonecheck:
        cdepth(convert) = c2
    Next convert
    clow = cdepth(1): If cdepth(2) < clow Then clow = cdepth(2)
    If cdepth(3) < clow Then clow = cdepth(3)
    mdepth(tri, 0) = clow: mdepth(tri, 1) = tri
Next tri
start = 1: finish = 528: Call QuickSort(start, finish, mdepth()) 'SORT ALL POLY POINTS FROM BACK TO FRONT for moon

'** RENDER THE 3D EARTH & MOON MODELS ****
For eloop = 1 To 529: thedot = depth(eloop, 1)
    If thedot = 529 Then GoTo drawmoon
    _MapTriangle _Seamless(mapcoordinate(thedot, 1, 0), mapcoordinate(thedot, 1, 1))-(mapcoordinate(thedot, 2, 0), mapcoordinate(thedot, 2, 1))-(mapcoordinate(thedot, 3, 0), mapcoordinate(thedot, 3, 1)), earthmap& To(dtoxy(thedot, 1, 0), dtoxy(thedot, 1, 1))-(dtoxy(thedot, 2, 0), dtoxy(thedot, 2, 1))-(dtoxy(thedot, 3, 0), dtoxy(thedot, 3, 1)), , _Smooth
    GoTo by
    drawmoon:
    For mloop = 1 To 528: thedot = mdepth(mloop, 1) 'draw moon
        _MapTriangle _Seamless(mapcoordinate(thedot, 1, 0), mapcoordinate(thedot, 1, 1))-(mapcoordinate(thedot, 2, 0), mapcoordinate(thedot, 2, 1))-(mapcoordinate(thedot, 3, 0), mapcoordinate(thedot, 3, 1)), moon& To(mtoxy(thedot, 1, 0), mtoxy(thedot, 1, 1))-(mtoxy(thedot, 2, 0), mtoxy(thedot, 2, 1))-(mtoxy(thedot, 3, 0), mtoxy(thedot, 3, 1)), , _Smooth
    Next mloop
    by:
Next eloop

'******************************************
If adjust_water = 0 Then GoTo moon_transparent
water_transparent:
Locate 1, 5: Print Using "Water Transparency: ###.#%"; 100 - (wtransparent / 255) * 100;: Line (10, 20)-(265, 24), _RGB32(255, 100, 100), BF: Circle (265 - wtransparent, 22), 3, _RGB32(0, 255, 0)
If (_MouseY < 16 Or _MouseY > 28) Or (_MouseX < 10 Or _MouseX > 265) Then GoTo finish
wtransparent = (265 - _MouseX): _SetAlpha 255, , earthmap&: _SetAlpha wtransparent, _RGB32(0, 0, 0) To _RGB32(5, 14, 30), earthmap&
GoTo finish

moon_transparent:
If adjust_moon = 0 Then GoTo showinfo
Locate 1, 6: Print Using "Moon Transparency: ###.#%"; 100 - (mtransparent / 255) * 100;: Line (10, 20)-(265, 24), _RGB32(255, 100, 100), BF: Circle (265 - mtransparent, 22), 3, _RGB32(0, 255, 0)
If (_MouseY < 16 Or _MouseY > 28) Or (_MouseX < 10 Or _MouseX > 265) Then GoTo finish
mtransparent = (265 - _MouseX): _SetAlpha 255, , moon&: _SetAlpha mtransparent, , moon&
GoTo finish

showinfo:
Color _RGB32(255, 255, 255): If info = -1 Then Locate 1, 1: Print "3D Earth Moon Model By OldsCool - Tap the spacebar to view data and keyboard commands...": GoTo finish
Locate 1, 1: Print "3D Earth Moon Model By OldsCool - Tap the spacebar to hide info...":
Locate 2, 1: Print "FPS:"; tfps;
Locate 3, 1: Print Using "Percent of scale: ###.####%"; posize;: Color _RGB32(0, 255, 0): Print "  Press Mouse-wheel-button + Move Mouse": Color _RGB32(255, 255, 255)
Locate 4, 1: Color _RGB32(255, 255, 255): Print Using "X Rotate: ###.####"; xrot;: Color _RGB32(0, 255, 0): Print " Right or Left Mouse"
Locate 5, 1: Color _RGB32(255, 255, 255): Print Using "Y Rotate: ###.####"; yrot;: Color _RGB32(0, 255, 0): Print " Right or Left Mouse"
Locate 6, 1: Color _RGB32(255, 255, 255): Print Using "Z Rotate: ###.####"; zrot;: Color _RGB32(0, 255, 0): Print "  Right Mouse + Left Mouse + Move"
Locate 7, 1: Color _RGB32(255, 255, 255): Print "Z-Perspective:"; zobs;: Color _RGB32(0, 255, 0): Print "  Right-Ctrl + Left-Mouse + Move"
Locate 8, 1: Color _RGB32(255, 255, 255): Print "Model Aspect:"; modelaspect;: Color _RGB32(0, 255, 0): Print "  Right-Shift + Left-Mouse + Move"
Locate 9, 1: Color _RGB32(255, 255, 255): Print "Rotation Mode:"; mrotmode; rm$(mrotmode);: Color _RGB32(0, 255, 0): Print "   Press [R]"
Locate 10, 1: Color _RGB32(255, 255, 255): Print "Earth Exaggeration:"; e_expand;: Color _RGB32(0, 255, 0): Print "  Left-Shift + Left-Mouse + Move"
Locate 11, 1: Color _RGB32(255, 255, 255): Print "Moon Exaggeration:"; m_expand;: Color _RGB32(0, 255, 0): Print "  Left-Ctrl + Left-Mouse + Move"
Locate 12, 1: Color _RGB32(255, 255, 255): Print "Increase the mouse speed while moving:";: Color _RGB32(0, 255, 0): Print "  Press and hold the UP arrow"
Locate 13, 1: Color _RGB32(255, 255, 255): Print "Decrease the mouse speed while moving:";: Color _RGB32(0, 255, 0): Print "  Press and hold the DOWN arrow"
Locate 14, 1: Color _RGB32(255, 255, 255): Print Using "Water Transparency: ###.#%"; 100 - (wtransparent / 255) * 100;: Color _RGB32(0, 255, 0): Print "  Press and hold [W] and HOVER over the slider"
Locate 15, 1: Color _RGB32(255, 255, 255): Print Using "Moon Transparency: ###.#%"; 100 - (mtransparent / 255) * 100;: Color _RGB32(0, 255, 0): Print "  Press and hold [M] and HOVER over the slider"
Locate 17, 1: Color _RGB32(0, 255, 0): Print "[Esc] to exit 3D Earth-Moon Model"

finish:
fps = fps + 1: _Display
GoTo MainLoop
'************************************************
'************************************************

fps: 'One Second Timer
If iflag = 1 Then info = -info: iflag = 0 'toggle view program data and instructions
If rflag = 1 Then rinfo = -rinfo: rflag = 0 'change rotation Mode / Method
tfps = fps: fps = 0: Return

'**** this is the only borrowed code in this program **** credit QB64 site
'*** SORT POLY POINT DEPTHS, BACK TO FRONT ********************************
Sub QuickSort (start As Integer, finish As Integer, depth() As Single)
    Dim Hi As Integer, Lo As Integer, Middle As Single
    Hi = finish: Lo = start
    Middle = depth((Lo + Hi) / 2, 0) 'find middle of array
    Do
        Do While depth(Lo, 0) < Middle: Lo = Lo + 1: Loop
        Do While depth(Hi, 0) > Middle: Hi = Hi - 1: Loop
        If Lo <= Hi Then
            Swap depth(Lo, 0), depth(Hi, 0): Swap depth(Lo, 1), depth(Hi, 1)
            Lo = Lo + 1: Hi = Hi - 1
        End If
    Loop Until Lo > Hi
    If Hi > start Then Call QuickSort(start, Hi, depth())
    If Lo < finish Then Call QuickSort(Lo, finish, depth())
End Sub

'******** DATA *********
'I ADDED this note on 1-5-2022.... the data below was originally created through a tedious method. I have since automated it, using just a small amount of data and calculating the rest
' values for map coordinates and the 3D Sphere model's lat/long points for _MAPTRIANGLE routines
'this is the data for the 528 poly sphere AND the texture image's x,y coordinates (for space, earth, moon)
Data 113,0,0,0,82,226,0,14,144,226,14,14
Data 82,226,0,14,55,453,0,29,171,453,14,29
Data 82,226,0,14,171,453,14,29,144,226,14,14
Data 55,453,0,29,33,680,0,44,193,680,14,44
Data 55,453,0,29,193,680,14,44,171,453,14,29
Data 33,680,0,44,16,907,0,59,210,907,14,59
Data 33,680,0,44,210,907,14,59,193,680,14,44
Data 16,907,0,59,4,1134,0,74,222,1134,14,74
Data 16,907,0,59,222,1134,14,74,210,907,14,59
Data 4,1134,0,74,0,1361,0,89,226,1361,14,89
Data 4,1134,0,74,226,1361,14,89,222,1134,14,74
Data 0,1361,0,89,4,1588,0,104,222,1588,14,104
Data 0,1361,0,89,222,1588,14,104,226,1361,14,89
Data 4,1588,0,104,16,1815,0,119,210,1815,14,119
Data 4,1588,0,104,210,1815,14,119,222,1588,14,104
Data 16,1815,0,119,33,2042,0,134,193,2042,14,134
Data 16,1815,0,119,193,2042,14,134,210,1815,14,119
Data 33,2042,0,134,55,2269,0,149,171,2269,14,149
Data 33,2042,0,134,171,2269,14,149,193,2042,14,134
Data 55,2269,0,149,82,2496,0,164,144,2496,14,164
Data 55,2269,0,149,144,2496,14,164,171,2269,14,149
Data 82,2496,0,164,113,2723,0,180,144,2496,14,164
Data 340,0,14,0,309,226,14,14,371,226,29,14
Data 309,226,14,14,282,453,14,29,398,453,29,29
Data 309,226,14,14,398,453,29,29,371,226,29,14
Data 282,453,14,29,260,680,14,44,420,680,29,44
Data 282,453,14,29,420,680,29,44,398,453,29,29
Data 260,680,14,44,243,907,14,59,437,907,29,59
Data 260,680,14,44,437,907,29,59,420,680,29,44
Data 243,907,14,59,231,1134,14,74,449,1134,29,74
Data 243,907,14,59,449,1134,29,74,437,907,29,59
Data 231,1134,14,74,227,1361,14,89,453,1361,29,89
Data 231,1134,14,74,453,1361,29,89,449,1134,29,74
Data 227,1361,14,89,231,1588,14,104,449,1588,29,104
Data 227,1361,14,89,449,1588,29,104,453,1361,29,89
Data 231,1588,14,104,243,1815,14,119,437,1815,29,119
Data 231,1588,14,104,437,1815,29,119,449,1588,29,104
Data 243,1815,14,119,260,2042,14,134,420,2042,29,134
Data 243,1815,14,119,420,2042,29,134,437,1815,29,119
Data 260,2042,14,134,282,2269,14,149,398,2269,29,149
Data 260,2042,14,134,398,2269,29,149,420,2042,29,134
Data 282,2269,14,149,309,2496,14,164,371,2496,29,164
Data 282,2269,14,149,371,2496,29,164,398,2269,29,149
Data 309,2496,14,164,340,2723,14,180,371,2496,29,164
Data 567,0,29,0,536,226,29,14,598,226,44,14
Data 536,226,29,14,509,453,29,29,625,453,44,29
Data 536,226,29,14,625,453,44,29,598,226,44,14
Data 509,453,29,29,487,680,29,44,647,680,44,44
Data 509,453,29,29,647,680,44,44,625,453,44,29
Data 487,680,29,44,470,907,29,59,664,907,44,59
Data 487,680,29,44,664,907,44,59,647,680,44,44
Data 470,907,29,59,458,1134,29,74,676,1134,44,74
Data 470,907,29,59,676,1134,44,74,664,907,44,59
Data 458,1134,29,74,454,1361,29,89,680,1361,44,89
Data 458,1134,29,74,680,1361,44,89,676,1134,44,74
Data 454,1361,29,89,458,1588,29,104,676,1588,44,104
Data 454,1361,29,89,676,1588,44,104,680,1361,44,89
Data 458,1588,29,104,470,1815,29,119,664,1815,44,119
Data 458,1588,29,104,664,1815,44,119,676,1588,44,104
Data 470,1815,29,119,487,2042,29,134,647,2042,44,134
Data 470,1815,29,119,647,2042,44,134,664,1815,44,119
Data 487,2042,29,134,509,2269,29,149,625,2269,44,149
Data 487,2042,29,134,625,2269,44,149,647,2042,44,134
Data 509,2269,29,149,536,2496,29,164,598,2496,44,164
Data 509,2269,29,149,598,2496,44,164,625,2269,44,149
Data 536,2496,29,164,567,2723,29,180,598,2496,44,164
Data 794,0,44,0,763,226,44,14,825,226,59,14
Data 763,226,44,14,736,453,44,29,852,453,59,29
Data 763,226,44,14,852,453,59,29,825,226,59,14
Data 736,453,44,29,714,680,44,44,874,680,59,44
Data 736,453,44,29,874,680,59,44,852,453,59,29
Data 714,680,44,44,697,907,44,59,891,907,59,59
Data 714,680,44,44,891,907,59,59,874,680,59,44
Data 697,907,44,59,685,1134,44,74,903,1134,59,74
Data 697,907,44,59,903,1134,59,74,891,907,59,59
Data 685,1134,44,74,681,1361,44,89,907,1361,59,89
Data 685,1134,44,74,907,1361,59,89,903,1134,59,74
Data 681,1361,44,89,685,1588,44,104,903,1588,59,104
Data 681,1361,44,89,903,1588,59,104,907,1361,59,89
Data 685,1588,44,104,697,1815,44,119,891,1815,59,119
Data 685,1588,44,104,891,1815,59,119,903,1588,59,104
Data 697,1815,44,119,714,2042,44,134,874,2042,59,134
Data 697,1815,44,119,874,2042,59,134,891,1815,59,119
Data 714,2042,44,134,736,2269,44,149,852,2269,59,149
Data 714,2042,44,134,852,2269,59,149,874,2042,59,134
Data 736,2269,44,149,763,2496,44,164,825,2496,59,164
Data 736,2269,44,149,825,2496,59,164,852,2269,59,149
Data 763,2496,44,164,794,2723,44,180,825,2496,59,164
Data 1021,0,59,0,990,226,59,14,1052,226,74,14
Data 990,226,59,14,963,453,59,29,1079,453,74,29
Data 990,226,59,14,1079,453,74,29,1052,226,74,14
Data 963,453,59,29,941,680,59,44,1101,680,74,44
Data 963,453,59,29,1101,680,74,44,1079,453,74,29
Data 941,680,59,44,924,907,59,59,1118,907,74,59
Data 941,680,59,44,1118,907,74,59,1101,680,74,44
Data 924,907,59,59,912,1134,59,74,1130,1134,74,74
Data 924,907,59,59,1130,1134,74,74,1118,907,74,59
Data 912,1134,59,74,908,1361,59,89,1134,1361,74,89
Data 912,1134,59,74,1134,1361,74,89,1130,1134,74,74
Data 908,1361,59,89,912,1588,59,104,1130,1588,74,104
Data 908,1361,59,89,1130,1588,74,104,1134,1361,74,89
Data 912,1588,59,104,924,1815,59,119,1118,1815,74,119
Data 912,1588,59,104,1118,1815,74,119,1130,1588,74,104
Data 924,1815,59,119,941,2042,59,134,1101,2042,74,134
Data 924,1815,59,119,1101,2042,74,134,1118,1815,74,119
Data 941,2042,59,134,963,2269,59,149,1079,2269,74,149
Data 941,2042,59,134,1079,2269,74,149,1101,2042,74,134
Data 963,2269,59,149,990,2496,59,164,1052,2496,74,164
Data 963,2269,59,149,1052,2496,74,164,1079,2269,74,149
Data 990,2496,59,164,1021,2723,59,180,1052,2496,74,164
Data 1248,0,74,0,1217,226,74,14,1279,226,89,14
Data 1217,226,74,14,1190,453,74,29,1306,453,89,29
Data 1217,226,74,14,1306,453,89,29,1279,226,89,14
Data 1190,453,74,29,1168,680,74,44,1328,680,89,44
Data 1190,453,74,29,1328,680,89,44,1306,453,89,29
Data 1168,680,74,44,1151,907,74,59,1345,907,89,59
Data 1168,680,74,44,1345,907,89,59,1328,680,89,44
Data 1151,907,74,59,1139,1134,74,74,1357,1134,89,74
Data 1151,907,74,59,1357,1134,89,74,1345,907,89,59
Data 1139,1134,74,74,1135,1361,74,89,1361,1361,89,89
Data 1139,1134,74,74,1361,1361,89,89,1357,1134,89,74
Data 1135,1361,74,89,1139,1588,74,104,1357,1588,89,104
Data 1135,1361,74,89,1357,1588,89,104,1361,1361,89,89
Data 1139,1588,74,104,1151,1815,74,119,1345,1815,89,119
Data 1139,1588,74,104,1345,1815,89,119,1357,1588,89,104
Data 1151,1815,74,119,1168,2042,74,134,1328,2042,89,134
Data 1151,1815,74,119,1328,2042,89,134,1345,1815,89,119
Data 1168,2042,74,134,1190,2269,74,149,1306,2269,89,149
Data 1168,2042,74,134,1306,2269,89,149,1328,2042,89,134
Data 1190,2269,74,149,1217,2496,74,164,1279,2496,89,164
Data 1190,2269,74,149,1279,2496,89,164,1306,2269,89,149
Data 1217,2496,74,164,1248,2723,74,180,1279,2496,89,164
Data 1475,0,89,0,1444,226,89,14,1506,226,104,14
Data 1444,226,89,14,1417,453,89,29,1533,453,104,29
Data 1444,226,89,14,1533,453,104,29,1506,226,104,14
Data 1417,453,89,29,1395,680,89,44,1555,680,104,44
Data 1417,453,89,29,1555,680,104,44,1533,453,104,29
Data 1395,680,89,44,1378,907,89,59,1572,907,104,59
Data 1395,680,89,44,1572,907,104,59,1555,680,104,44
Data 1378,907,89,59,1366,1134,89,74,1584,1134,104,74
Data 1378,907,89,59,1584,1134,104,74,1572,907,104,59
Data 1366,1134,89,74,1362,1361,89,89,1588,1361,104,89
Data 1366,1134,89,74,1588,1361,104,89,1584,1134,104,74
Data 1362,1361,89,89,1366,1588,89,104,1584,1588,104,104
Data 1362,1361,89,89,1584,1588,104,104,1588,1361,104,89
Data 1366,1588,89,104,1378,1815,89,119,1572,1815,104,119
Data 1366,1588,89,104,1572,1815,104,119,1584,1588,104,104
Data 1378,1815,89,119,1395,2042,89,134,1555,2042,104,134
Data 1378,1815,89,119,1555,2042,104,134,1572,1815,104,119
Data 1395,2042,89,134,1417,2269,89,149,1533,2269,104,149
Data 1395,2042,89,134,1533,2269,104,149,1555,2042,104,134
Data 1417,2269,89,149,1444,2496,89,164,1506,2496,104,164
Data 1417,2269,89,149,1506,2496,104,164,1533,2269,104,149
Data 1444,2496,89,164,1475,2723,89,180,1506,2496,104,164
Data 1702,0,104,0,1671,226,104,14,1733,226,119,14
Data 1671,226,104,14,1644,453,104,29,1760,453,119,29
Data 1671,226,104,14,1760,453,119,29,1733,226,119,14
Data 1644,453,104,29,1622,680,104,44,1782,680,119,44
Data 1644,453,104,29,1782,680,119,44,1760,453,119,29
Data 1622,680,104,44,1605,907,104,59,1799,907,119,59
Data 1622,680,104,44,1799,907,119,59,1782,680,119,44
Data 1605,907,104,59,1593,1134,104,74,1811,1134,119,74
Data 1605,907,104,59,1811,1134,119,74,1799,907,119,59
Data 1593,1134,104,74,1589,1361,104,89,1815,1361,119,89
Data 1593,1134,104,74,1815,1361,119,89,1811,1134,119,74
Data 1589,1361,104,89,1593,1588,104,104,1811,1588,119,104
Data 1589,1361,104,89,1811,1588,119,104,1815,1361,119,89
Data 1593,1588,104,104,1605,1815,104,119,1799,1815,119,119
Data 1593,1588,104,104,1799,1815,119,119,1811,1588,119,104
Data 1605,1815,104,119,1622,2042,104,134,1782,2042,119,134
Data 1605,1815,104,119,1782,2042,119,134,1799,1815,119,119
Data 1622,2042,104,134,1644,2269,104,149,1760,2269,119,149
Data 1622,2042,104,134,1760,2269,119,149,1782,2042,119,134
Data 1644,2269,104,149,1671,2496,104,164,1733,2496,119,164
Data 1644,2269,104,149,1733,2496,119,164,1760,2269,119,149
Data 1671,2496,104,164,1702,2723,104,180,1733,2496,119,164
Data 1929,0,119,0,1898,226,119,14,1960,226,134,14
Data 1898,226,119,14,1871,453,119,29,1987,453,134,29
Data 1898,226,119,14,1987,453,134,29,1960,226,134,14
Data 1871,453,119,29,1849,680,119,44,2009,680,134,44
Data 1871,453,119,29,2009,680,134,44,1987,453,134,29
Data 1849,680,119,44,1832,907,119,59,2026,907,134,59
Data 1849,680,119,44,2026,907,134,59,2009,680,134,44
Data 1832,907,119,59,1820,1134,119,74,2038,1134,134,74
Data 1832,907,119,59,2038,1134,134,74,2026,907,134,59
Data 1820,1134,119,74,1816,1361,119,89,2042,1361,134,89
Data 1820,1134,119,74,2042,1361,134,89,2038,1134,134,74
Data 1816,1361,119,89,1820,1588,119,104,2038,1588,134,104
Data 1816,1361,119,89,2038,1588,134,104,2042,1361,134,89
Data 1820,1588,119,104,1832,1815,119,119,2026,1815,134,119
Data 1820,1588,119,104,2026,1815,134,119,2038,1588,134,104
Data 1832,1815,119,119,1849,2042,119,134,2009,2042,134,134
Data 1832,1815,119,119,2009,2042,134,134,2026,1815,134,119
Data 1849,2042,119,134,1871,2269,119,149,1987,2269,134,149
Data 1849,2042,119,134,1987,2269,134,149,2009,2042,134,134
Data 1871,2269,119,149,1898,2496,119,164,1960,2496,134,164
Data 1871,2269,119,149,1960,2496,134,164,1987,2269,134,149
Data 1898,2496,119,164,1929,2723,119,180,1960,2496,134,164
Data 2156,0,134,0,2125,226,134,14,2187,226,149,14
Data 2125,226,134,14,2098,453,134,29,2214,453,149,29
Data 2125,226,134,14,2214,453,149,29,2187,226,149,14
Data 2098,453,134,29,2076,680,134,44,2236,680,149,44
Data 2098,453,134,29,2236,680,149,44,2214,453,149,29
Data 2076,680,134,44,2059,907,134,59,2253,907,149,59
Data 2076,680,134,44,2253,907,149,59,2236,680,149,44
Data 2059,907,134,59,2047,1134,134,74,2265,1134,149,74
Data 2059,907,134,59,2265,1134,149,74,2253,907,149,59
Data 2047,1134,134,74,2043,1361,134,89,2269,1361,149,89
Data 2047,1134,134,74,2269,1361,149,89,2265,1134,149,74
Data 2043,1361,134,89,2047,1588,134,104,2265,1588,149,104
Data 2043,1361,134,89,2265,1588,149,104,2269,1361,149,89
Data 2047,1588,134,104,2059,1815,134,119,2253,1815,149,119
Data 2047,1588,134,104,2253,1815,149,119,2265,1588,149,104
Data 2059,1815,134,119,2076,2042,134,134,2236,2042,149,134
Data 2059,1815,134,119,2236,2042,149,134,2253,1815,149,119
Data 2076,2042,134,134,2098,2269,134,149,2214,2269,149,149
Data 2076,2042,134,134,2214,2269,149,149,2236,2042,149,134
Data 2098,2269,134,149,2125,2496,134,164,2187,2496,149,164
Data 2098,2269,134,149,2187,2496,149,164,2214,2269,149,149
Data 2125,2496,134,164,2156,2723,134,180,2187,2496,149,164
Data 2383,0,149,0,2352,226,149,14,2414,226,164,14
Data 2352,226,149,14,2325,453,149,29,2441,453,164,29
Data 2352,226,149,14,2441,453,164,29,2414,226,164,14
Data 2325,453,149,29,2303,680,149,44,2463,680,164,44
Data 2325,453,149,29,2463,680,164,44,2441,453,164,29
Data 2303,680,149,44,2286,907,149,59,2480,907,164,59
Data 2303,680,149,44,2480,907,164,59,2463,680,164,44
Data 2286,907,149,59,2274,1134,149,74,2492,1134,164,74
Data 2286,907,149,59,2492,1134,164,74,2480,907,164,59
Data 2274,1134,149,74,2270,1361,149,89,2496,1361,164,89
Data 2274,1134,149,74,2496,1361,164,89,2492,1134,164,74
Data 2270,1361,149,89,2274,1588,149,104,2492,1588,164,104
Data 2270,1361,149,89,2492,1588,164,104,2496,1361,164,89
Data 2274,1588,149,104,2286,1815,149,119,2480,1815,164,119
Data 2274,1588,149,104,2480,1815,164,119,2492,1588,164,104
Data 2286,1815,149,119,2303,2042,149,134,2463,2042,164,134
Data 2286,1815,149,119,2463,2042,164,134,2480,1815,164,119
Data 2303,2042,149,134,2325,2269,149,149,2441,2269,164,149
Data 2303,2042,149,134,2441,2269,164,149,2463,2042,164,134
Data 2325,2269,149,149,2352,2496,149,164,2414,2496,164,164
Data 2325,2269,149,149,2414,2496,164,164,2441,2269,164,149
Data 2352,2496,149,164,2383,2723,149,180,2414,2496,164,164
Data 2610,0,164,0,2579,226,164,14,2641,226,179,14
Data 2579,226,164,14,2552,453,164,29,2668,453,179,29
Data 2579,226,164,14,2668,453,179,29,2641,226,179,14
Data 2552,453,164,29,2530,680,164,44,2690,680,179,44
Data 2552,453,164,29,2690,680,179,44,2668,453,179,29
Data 2530,680,164,44,2513,907,164,59,2707,907,179,59
Data 2530,680,164,44,2707,907,179,59,2690,680,179,44
Data 2513,907,164,59,2501,1134,164,74,2719,1134,179,74
Data 2513,907,164,59,2719,1134,179,74,2707,907,179,59
Data 2501,1134,164,74,2497,1361,164,89,2723,1361,179,89
Data 2501,1134,164,74,2723,1361,179,89,2719,1134,179,74
Data 2497,1361,164,89,2501,1588,164,104,2719,1588,179,104
Data 2497,1361,164,89,2719,1588,179,104,2723,1361,179,89
Data 2501,1588,164,104,2513,1815,164,119,2707,1815,179,119
Data 2501,1588,164,104,2707,1815,179,119,2719,1588,179,104
Data 2513,1815,164,119,2530,2042,164,134,2690,2042,179,134
Data 2513,1815,164,119,2690,2042,179,134,2707,1815,179,119
Data 2530,2042,164,134,2552,2269,164,149,2668,2269,179,149
Data 2530,2042,164,134,2668,2269,179,149,2690,2042,179,134
Data 2552,2269,164,149,2579,2496,164,164,2641,2496,179,164
Data 2552,2269,164,149,2641,2496,179,164,2668,2269,179,149
Data 2579,2496,164,164,2610,2723,164,180,2641,2496,179,164
Data 2837,0,179,0,2806,226,179,14,2868,226,194,14
Data 2806,226,179,14,2779,453,179,29,2895,453,194,29
Data 2806,226,179,14,2895,453,194,29,2868,226,194,14
Data 2779,453,179,29,2757,680,179,44,2917,680,194,44
Data 2779,453,179,29,2917,680,194,44,2895,453,194,29
Data 2757,680,179,44,2740,907,179,59,2934,907,194,59
Data 2757,680,179,44,2934,907,194,59,2917,680,194,44
Data 2740,907,179,59,2728,1134,179,74,2946,1134,194,74
Data 2740,907,179,59,2946,1134,194,74,2934,907,194,59
Data 2728,1134,179,74,2724,1361,179,89,2950,1361,194,89
Data 2728,1134,179,74,2950,1361,194,89,2946,1134,194,74
Data 2724,1361,179,89,2728,1588,179,104,2946,1588,194,104
Data 2724,1361,179,89,2946,1588,194,104,2950,1361,194,89
Data 2728,1588,179,104,2740,1815,179,119,2934,1815,194,119
Data 2728,1588,179,104,2934,1815,194,119,2946,1588,194,104
Data 2740,1815,179,119,2757,2042,179,134,2917,2042,194,134
Data 2740,1815,179,119,2917,2042,194,134,2934,1815,194,119
Data 2757,2042,179,134,2779,2269,179,149,2895,2269,194,149
Data 2757,2042,179,134,2895,2269,194,149,2917,2042,194,134
Data 2779,2269,179,149,2806,2496,179,164,2868,2496,194,164
Data 2779,2269,179,149,2868,2496,194,164,2895,2269,194,149
Data 2806,2496,179,164,2837,2723,179,180,2868,2496,194,164
Data 3064,0,194,0,3033,226,194,14,3095,226,209,14
Data 3033,226,194,14,3006,453,194,29,3122,453,209,29
Data 3033,226,194,14,3122,453,209,29,3095,226,209,14
Data 3006,453,194,29,2984,680,194,44,3144,680,209,44
Data 3006,453,194,29,3144,680,209,44,3122,453,209,29
Data 2984,680,194,44,2967,907,194,59,3161,907,209,59
Data 2984,680,194,44,3161,907,209,59,3144,680,209,44
Data 2967,907,194,59,2955,1134,194,74,3173,1134,209,74
Data 2967,907,194,59,3173,1134,209,74,3161,907,209,59
Data 2955,1134,194,74,2951,1361,194,89,3177,1361,209,89
Data 2955,1134,194,74,3177,1361,209,89,3173,1134,209,74
Data 2951,1361,194,89,2955,1588,194,104,3173,1588,209,104
Data 2951,1361,194,89,3173,1588,209,104,3177,1361,209,89
Data 2955,1588,194,104,2967,1815,194,119,3161,1815,209,119
Data 2955,1588,194,104,3161,1815,209,119,3173,1588,209,104
Data 2967,1815,194,119,2984,2042,194,134,3144,2042,209,134
Data 2967,1815,194,119,3144,2042,209,134,3161,1815,209,119
Data 2984,2042,194,134,3006,2269,194,149,3122,2269,209,149
Data 2984,2042,194,134,3122,2269,209,149,3144,2042,209,134
Data 3006,2269,194,149,3033,2496,194,164,3095,2496,209,164
Data 3006,2269,194,149,3095,2496,209,164,3122,2269,209,149
Data 3033,2496,194,164,3064,2723,194,180,3095,2496,209,164
Data 3291,0,209,0,3260,226,209,14,3322,226,224,14
Data 3260,226,209,14,3233,453,209,29,3349,453,224,29
Data 3260,226,209,14,3349,453,224,29,3322,226,224,14
Data 3233,453,209,29,3211,680,209,44,3371,680,224,44
Data 3233,453,209,29,3371,680,224,44,3349,453,224,29
Data 3211,680,209,44,3194,907,209,59,3388,907,224,59
Data 3211,680,209,44,3388,907,224,59,3371,680,224,44
Data 3194,907,209,59,3182,1134,209,74,3400,1134,224,74
Data 3194,907,209,59,3400,1134,224,74,3388,907,224,59
Data 3182,1134,209,74,3178,1361,209,89,3404,1361,224,89
Data 3182,1134,209,74,3404,1361,224,89,3400,1134,224,74
Data 3178,1361,209,89,3182,1588,209,104,3400,1588,224,104
Data 3178,1361,209,89,3400,1588,224,104,3404,1361,224,89
Data 3182,1588,209,104,3194,1815,209,119,3388,1815,224,119
Data 3182,1588,209,104,3388,1815,224,119,3400,1588,224,104
Data 3194,1815,209,119,3211,2042,209,134,3371,2042,224,134
Data 3194,1815,209,119,3371,2042,224,134,3388,1815,224,119
Data 3211,2042,209,134,3233,2269,209,149,3349,2269,224,149
Data 3211,2042,209,134,3349,2269,224,149,3371,2042,224,134
Data 3233,2269,209,149,3260,2496,209,164,3322,2496,224,164
Data 3233,2269,209,149,3322,2496,224,164,3349,2269,224,149
Data 3260,2496,209,164,3291,2723,209,180,3322,2496,224,164
Data 3518,0,224,0,3487,226,224,14,3549,226,239,14
Data 3487,226,224,14,3460,453,224,29,3576,453,239,29
Data 3487,226,224,14,3576,453,239,29,3549,226,239,14
Data 3460,453,224,29,3438,680,224,44,3598,680,239,44
Data 3460,453,224,29,3598,680,239,44,3576,453,239,29
Data 3438,680,224,44,3421,907,224,59,3615,907,239,59
Data 3438,680,224,44,3615,907,239,59,3598,680,239,44
Data 3421,907,224,59,3409,1134,224,74,3627,1134,239,74
Data 3421,907,224,59,3627,1134,239,74,3615,907,239,59
Data 3409,1134,224,74,3405,1361,224,89,3631,1361,239,89
Data 3409,1134,224,74,3631,1361,239,89,3627,1134,239,74
Data 3405,1361,224,89,3409,1588,224,104,3627,1588,239,104
Data 3405,1361,224,89,3627,1588,239,104,3631,1361,239,89
Data 3409,1588,224,104,3421,1815,224,119,3615,1815,239,119
Data 3409,1588,224,104,3615,1815,239,119,3627,1588,239,104
Data 3421,1815,224,119,3438,2042,224,134,3598,2042,239,134
Data 3421,1815,224,119,3598,2042,239,134,3615,1815,239,119
Data 3438,2042,224,134,3460,2269,224,149,3576,2269,239,149
Data 3438,2042,224,134,3576,2269,239,149,3598,2042,239,134
Data 3460,2269,224,149,3487,2496,224,164,3549,2496,239,164
Data 3460,2269,224,149,3549,2496,239,164,3576,2269,239,149
Data 3487,2496,224,164,3518,2723,224,180,3549,2496,239,164
Data 3745,0,239,0,3714,226,239,14,3776,226,254,14
Data 3714,226,239,14,3687,453,239,29,3803,453,254,29
Data 3714,226,239,14,3803,453,254,29,3776,226,254,14
Data 3687,453,239,29,3665,680,239,44,3825,680,254,44
Data 3687,453,239,29,3825,680,254,44,3803,453,254,29
Data 3665,680,239,44,3648,907,239,59,3842,907,254,59
Data 3665,680,239,44,3842,907,254,59,3825,680,254,44
Data 3648,907,239,59,3636,1134,239,74,3854,1134,254,74
Data 3648,907,239,59,3854,1134,254,74,3842,907,254,59
Data 3636,1134,239,74,3632,1361,239,89,3858,1361,254,89
Data 3636,1134,239,74,3858,1361,254,89,3854,1134,254,74
Data 3632,1361,239,89,3636,1588,239,104,3854,1588,254,104
Data 3632,1361,239,89,3854,1588,254,104,3858,1361,254,89
Data 3636,1588,239,104,3648,1815,239,119,3842,1815,254,119
Data 3636,1588,239,104,3842,1815,254,119,3854,1588,254,104
Data 3648,1815,239,119,3665,2042,239,134,3825,2042,254,134
Data 3648,1815,239,119,3825,2042,254,134,3842,1815,254,119
Data 3665,2042,239,134,3687,2269,239,149,3803,2269,254,149
Data 3665,2042,239,134,3803,2269,254,149,3825,2042,254,134
Data 3687,2269,239,149,3714,2496,239,164,3776,2496,254,164
Data 3687,2269,239,149,3776,2496,254,164,3803,2269,254,149
Data 3714,2496,239,164,3745,2723,239,180,3776,2496,254,164
Data 3972,0,254,0,3941,226,254,14,4003,226,269,14
Data 3941,226,254,14,3914,453,254,29,4030,453,269,29
Data 3941,226,254,14,4030,453,269,29,4003,226,269,14
Data 3914,453,254,29,3892,680,254,44,4052,680,269,44
Data 3914,453,254,29,4052,680,269,44,4030,453,269,29
Data 3892,680,254,44,3875,907,254,59,4069,907,269,59
Data 3892,680,254,44,4069,907,269,59,4052,680,269,44
Data 3875,907,254,59,3863,1134,254,74,4081,1134,269,74
Data 3875,907,254,59,4081,1134,269,74,4069,907,269,59
Data 3863,1134,254,74,3859,1361,254,89,4085,1361,269,89
Data 3863,1134,254,74,4085,1361,269,89,4081,1134,269,74
Data 3859,1361,254,89,3863,1588,254,104,4081,1588,269,104
Data 3859,1361,254,89,4081,1588,269,104,4085,1361,269,89
Data 3863,1588,254,104,3875,1815,254,119,4069,1815,269,119
Data 3863,1588,254,104,4069,1815,269,119,4081,1588,269,104
Data 3875,1815,254,119,3892,2042,254,134,4052,2042,269,134
Data 3875,1815,254,119,4052,2042,269,134,4069,1815,269,119
Data 3892,2042,254,134,3914,2269,254,149,4030,2269,269,149
Data 3892,2042,254,134,4030,2269,269,149,4052,2042,269,134
Data 3914,2269,254,149,3941,2496,254,164,4003,2496,269,164
Data 3914,2269,254,149,4003,2496,269,164,4030,2269,269,149
Data 3941,2496,254,164,3972,2723,254,180,4003,2496,269,164
Data 4199,0,269,0,4168,226,269,14,4230,226,284,14
Data 4168,226,269,14,4141,453,269,29,4257,453,284,29
Data 4168,226,269,14,4257,453,284,29,4230,226,284,14
Data 4141,453,269,29,4119,680,269,44,4279,680,284,44
Data 4141,453,269,29,4279,680,284,44,4257,453,284,29
Data 4119,680,269,44,4102,907,269,59,4296,907,284,59
Data 4119,680,269,44,4296,907,284,59,4279,680,284,44
Data 4102,907,269,59,4090,1134,269,74,4308,1134,284,74
Data 4102,907,269,59,4308,1134,284,74,4296,907,284,59
Data 4090,1134,269,74,4086,1361,269,89,4312,1361,284,89
Data 4090,1134,269,74,4312,1361,284,89,4308,1134,284,74
Data 4086,1361,269,89,4090,1588,269,104,4308,1588,284,104
Data 4086,1361,269,89,4308,1588,284,104,4312,1361,284,89
Data 4090,1588,269,104,4102,1815,269,119,4296,1815,284,119
Data 4090,1588,269,104,4296,1815,284,119,4308,1588,284,104
Data 4102,1815,269,119,4119,2042,269,134,4279,2042,284,134
Data 4102,1815,269,119,4279,2042,284,134,4296,1815,284,119
Data 4119,2042,269,134,4141,2269,269,149,4257,2269,284,149
Data 4119,2042,269,134,4257,2269,284,149,4279,2042,284,134
Data 4141,2269,269,149,4168,2496,269,164,4230,2496,284,164
Data 4141,2269,269,149,4230,2496,284,164,4257,2269,284,149
Data 4168,2496,269,164,4199,2723,269,180,4230,2496,284,164
Data 4426,0,284,0,4395,226,284,14,4457,226,299,14
Data 4395,226,284,14,4368,453,284,29,4484,453,299,29
Data 4395,226,284,14,4484,453,299,29,4457,226,299,14
Data 4368,453,284,29,4346,680,284,44,4506,680,299,44
Data 4368,453,284,29,4506,680,299,44,4484,453,299,29
Data 4346,680,284,44,4329,907,284,59,4523,907,299,59
Data 4346,680,284,44,4523,907,299,59,4506,680,299,44
Data 4329,907,284,59,4317,1134,284,74,4535,1134,299,74
Data 4329,907,284,59,4535,1134,299,74,4523,907,299,59
Data 4317,1134,284,74,4313,1361,284,89,4539,1361,299,89
Data 4317,1134,284,74,4539,1361,299,89,4535,1134,299,74
Data 4313,1361,284,89,4317,1588,284,104,4535,1588,299,104
Data 4313,1361,284,89,4535,1588,299,104,4539,1361,299,89
Data 4317,1588,284,104,4329,1815,284,119,4523,1815,299,119
Data 4317,1588,284,104,4523,1815,299,119,4535,1588,299,104
Data 4329,1815,284,119,4346,2042,284,134,4506,2042,299,134
Data 4329,1815,284,119,4506,2042,299,134,4523,1815,299,119
Data 4346,2042,284,134,4368,2269,284,149,4484,2269,299,149
Data 4346,2042,284,134,4484,2269,299,149,4506,2042,299,134
Data 4368,2269,284,149,4395,2496,284,164,4457,2496,299,164
Data 4368,2269,284,149,4457,2496,299,164,4484,2269,299,149
Data 4395,2496,284,164,4426,2723,284,180,4457,2496,299,164
Data 4653,0,299,0,4622,226,299,14,4684,226,314,14
Data 4622,226,299,14,4595,453,299,29,4711,453,314,29
Data 4622,226,299,14,4711,453,314,29,4684,226,314,14
Data 4595,453,299,29,4573,680,299,44,4733,680,314,44
Data 4595,453,299,29,4733,680,314,44,4711,453,314,29
Data 4573,680,299,44,4556,907,299,59,4750,907,314,59
Data 4573,680,299,44,4750,907,314,59,4733,680,314,44
Data 4556,907,299,59,4544,1134,299,74,4762,1134,314,74
Data 4556,907,299,59,4762,1134,314,74,4750,907,314,59
Data 4544,1134,299,74,4540,1361,299,89,4766,1361,314,89
Data 4544,1134,299,74,4766,1361,314,89,4762,1134,314,74
Data 4540,1361,299,89,4544,1588,299,104,4762,1588,314,104
Data 4540,1361,299,89,4762,1588,314,104,4766,1361,314,89
Data 4544,1588,299,104,4556,1815,299,119,4750,1815,314,119
Data 4544,1588,299,104,4750,1815,314,119,4762,1588,314,104
Data 4556,1815,299,119,4573,2042,299,134,4733,2042,314,134
Data 4556,1815,299,119,4733,2042,314,134,4750,1815,314,119
Data 4573,2042,299,134,4595,2269,299,149,4711,2269,314,149
Data 4573,2042,299,134,4711,2269,314,149,4733,2042,314,134
Data 4595,2269,299,149,4622,2496,299,164,4684,2496,314,164
Data 4595,2269,299,149,4684,2496,314,164,4711,2269,314,149
Data 4622,2496,299,164,4653,2723,299,180,4684,2496,314,164
Data 4880,0,314,0,4849,226,314,14,4911,226,329,14
Data 4849,226,314,14,4822,453,314,29,4938,453,329,29
Data 4849,226,314,14,4938,453,329,29,4911,226,329,14
Data 4822,453,314,29,4800,680,314,44,4960,680,329,44
Data 4822,453,314,29,4960,680,329,44,4938,453,329,29
Data 4800,680,314,44,4783,907,314,59,4977,907,329,59
Data 4800,680,314,44,4977,907,329,59,4960,680,329,44
Data 4783,907,314,59,4771,1134,314,74,4989,1134,329,74
Data 4783,907,314,59,4989,1134,329,74,4977,907,329,59
Data 4771,1134,314,74,4767,1361,314,89,4993,1361,329,89
Data 4771,1134,314,74,4993,1361,329,89,4989,1134,329,74
Data 4767,1361,314,89,4771,1588,314,104,4989,1588,329,104
Data 4767,1361,314,89,4989,1588,329,104,4993,1361,329,89
Data 4771,1588,314,104,4783,1815,314,119,4977,1815,329,119
Data 4771,1588,314,104,4977,1815,329,119,4989,1588,329,104
Data 4783,1815,314,119,4800,2042,314,134,4960,2042,329,134
Data 4783,1815,314,119,4960,2042,329,134,4977,1815,329,119
Data 4800,2042,314,134,4822,2269,314,149,4938,2269,329,149
Data 4800,2042,314,134,4938,2269,329,149,4960,2042,329,134
Data 4822,2269,314,149,4849,2496,314,164,4911,2496,329,164
Data 4822,2269,314,149,4911,2496,329,164,4938,2269,329,149
Data 4849,2496,314,164,4880,2723,314,180,4911,2496,329,164
Data 5107,0,329,0,5076,226,329,14,5138,226,344,14
Data 5076,226,329,14,5049,453,329,29,5165,453,344,29
Data 5076,226,329,14,5165,453,344,29,5138,226,344,14
Data 5049,453,329,29,5027,680,329,44,5187,680,344,44
Data 5049,453,329,29,5187,680,344,44,5165,453,344,29
Data 5027,680,329,44,5010,907,329,59,5204,907,344,59
Data 5027,680,329,44,5204,907,344,59,5187,680,344,44
Data 5010,907,329,59,4998,1134,329,74,5216,1134,344,74
Data 5010,907,329,59,5216,1134,344,74,5204,907,344,59
Data 4998,1134,329,74,4994,1361,329,89,5220,1361,344,89
Data 4998,1134,329,74,5220,1361,344,89,5216,1134,344,74
Data 4994,1361,329,89,4998,1588,329,104,5216,1588,344,104
Data 4994,1361,329,89,5216,1588,344,104,5220,1361,344,89
Data 4998,1588,329,104,5010,1815,329,119,5204,1815,344,119
Data 4998,1588,329,104,5204,1815,344,119,5216,1588,344,104
Data 5010,1815,329,119,5027,2042,329,134,5187,2042,344,134
Data 5010,1815,329,119,5187,2042,344,134,5204,1815,344,119
Data 5027,2042,329,134,5049,2269,329,149,5165,2269,344,149
Data 5027,2042,329,134,5165,2269,344,149,5187,2042,344,134
Data 5049,2269,329,149,5076,2496,329,164,5138,2496,344,164
Data 5049,2269,329,149,5138,2496,344,164,5165,2269,344,149
Data 5076,2496,329,164,5107,2723,329,180,5138,2496,344,164
Data 5334,0,344,0,5303,226,344,14,5365,226,0,14
Data 5303,226,344,14,5276,453,344,29,5392,453,0,29
Data 5303,226,344,14,5392,453,0,29,5365,226,0,14
Data 5276,453,344,29,5254,680,344,44,5414,680,0,44
Data 5276,453,344,29,5414,680,0,44,5392,453,0,29
Data 5254,680,344,44,5237,907,344,59,5431,907,0,59
Data 5254,680,344,44,5431,907,0,59,5414,680,0,44
Data 5237,907,344,59,5225,1134,344,74,5443,1134,0,74
Data 5237,907,344,59,5443,1134,0,74,5431,907,0,59
Data 5225,1134,344,74,5221,1361,344,89,5447,1361,0,89
Data 5225,1134,344,74,5447,1361,0,89,5443,1134,0,74
Data 5221,1361,344,89,5225,1588,344,104,5443,1588,0,104
Data 5221,1361,344,89,5443,1588,0,104,5447,1361,0,89
Data 5225,1588,344,104,5237,1815,344,119,5431,1815,0,119
Data 5225,1588,344,104,5431,1815,0,119,5443,1588,0,104
Data 5237,1815,344,119,5254,2042,344,134,5414,2042,0,134
Data 5237,1815,344,119,5414,2042,0,134,5431,1815,0,119
Data 5254,2042,344,134,5276,2269,344,149,5392,2269,0,149
Data 5254,2042,344,134,5392,2269,0,149,5414,2042,0,134
Data 5276,2269,344,149,5303,2496,344,164,5365,2496,0,164
Data 5276,2269,344,149,5365,2496,0,164,5392,2269,0,149
Data 5303,2496,344,164,5334,2723,344,180,5365,2496,0,164
'next data set contains the moon's orbit values around earth (all three sets of longitude / latitude TO BE IDENTICAL) (positions 3,4 / 7,8 / 11,12)
Data 0,0,0,90,0,0,0,90,0,0,0,90

