first commit
This commit is contained in:
19
Ugesedler/Ugeseddel-6 08-10-2025/Opgave-6-ZipLookup.py
Normal file
19
Ugesedler/Ugeseddel-6 08-10-2025/Opgave-6-ZipLookup.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import math
|
||||
RADIUS = 3956.6
|
||||
|
||||
def distance(lat1, long1, lat2, long2):
|
||||
lat1 = math.radians(lat1)
|
||||
long1 = math.radians(long1)
|
||||
lat2 = math.radians(lat2)
|
||||
long2 = math.radians(long2)
|
||||
the_cos = math.sin(lat1) * math.sin(lat2) + math.cos(lat1) * math.cos(lat2) * math.cos(long1 - long2)
|
||||
arc_length = math.acos(the_cos)
|
||||
return arc_length * RADIUS
|
||||
|
||||
def find(target, file):
|
||||
|
||||
|
||||
def main():
|
||||
zip = input("What Zip code are you interested in? ")
|
||||
target = float(input("And what proximity (in miles)? "))
|
||||
with open("zipcodes.txt") as file:
|
||||
Reference in New Issue
Block a user