summaryrefslogtreecommitdiff
path: root/map2globe.py
diff options
context:
space:
mode:
Diffstat (limited to 'map2globe.py')
-rwxr-xr-xmap2globe.py53
1 files changed, 0 insertions, 53 deletions
diff --git a/map2globe.py b/map2globe.py
deleted file mode 100755
index 9ba0b42..0000000
--- a/map2globe.py
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/usr/bin/python3.6
-
-import sys
-import math
-
-plat=0
-plon=0
-lat=0
-lon=0
-x="0"
-y="0"
-z="0"
-
-#lon goes from -180 to +180
-#lat goes from -90 to +90
-# / 90 * math.pi
-#they need to be in the range 0 to 2pi?
-
-print("globe addshape 4 1 0 0 0 1 0 0")
-rotation=0
-
-while(1):
- #print (plat,plon,lat,lon)
- try:
- line=input()
- line.strip('\r\n')
- (lon,lat)=map(float,filter(None,line.split(' ')))
- slat=(((lat)/180)*math.pi)
- slon=(((lon)/180)*math.pi)
- (x,y,z)=map(str,(math.cos(slat)*math.cos(slon), math.sin(slat),math.cos(slat)*math.sin(slon)))
-# (x,y,z)=map(str,(slon,slat,0))
- except EOFError:
- print("# reached EOF")
- break
- except ValueError:
- #ignore this line
- print("# read an invalid line: " + line)
- if(line == ""):
- (lat,lon,x,y,z)=(0,0,"","","")
- except:
- e = sys.exc_info()[0]
- print("# error: " + str(e))
- break
- if(lat and lon and x and y and z and plat and plon and px and py and pz): #if the previouses exist
- print("globe addshape 2 2 " + x + " " + y + " " + z + " " + px + " " + py + " " + pz)
- print("globe rotate 0 " + str(rotation) + " 0")
- rotation+=1
- rotation%=360
-
-#set previouses to currents
- (plat,plon,px,py,pz)=(lat,lon,x,y,z)
-
-print("# done")