Skip to content

Commit

Permalink
Implemented multi-view matplotlib cluster interface; Fixed some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Sieboldianus committed Dec 21, 2017
1 parent 3c295f4 commit 31acf86
Show file tree
Hide file tree
Showing 4 changed files with 873 additions and 141 deletions.
Binary file modified __pycache__/def_functions.cpython-36.pyc
Binary file not shown.
17 changes: 17 additions & 0 deletions def_functions.py
Expand Up @@ -40,6 +40,23 @@ def daterange(start_date, end_date):
for n in range(int ((end_date - start_date).days)):
yield start_date + timedelta(n)

from math import radians, cos, sin, asin, sqrt
def haversine(lon1, lat1, lon2, lat2):
"""
Calculate the great circle distance between two points
on the earth (specified in decimal degrees)
"""
# convert decimal degrees to radians
lon1, lat1, lon2, lat2 = map(radians, [lon1, lat1, lon2, lat2])
# haversine formula
dlon = lon2 - lon1
dlat = lat2 - lat1
a = sin(dlat/2)**2 + cos(lat1) * cos(lat2) * sin(dlon/2)**2
c = 2 * asin(sqrt(a))
# Radius of earth in kilometers is 6371
km = 6371* c
m = km*1000
return m

#this class is needed to override tkinter window with drag&drop option when overrideredirect = true
#class App:
Expand Down

0 comments on commit 31acf86

Please sign in to comment.