Advertisement
Guest User

Untitled

a guest
Dec 5th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. lon = float(input().replace(',', '.'))
  2. lat = float(input().replace(',', '.'))
  3. n = int(input())
  4. for i in range(n):
  5. defib = input()
  6. dane = defib.split(";")
  7. lon_d = float(dane[4].replace(',', '.'))
  8. lat_d = float(dane[5].replace(',', '.'))
  9. x = (lon_d - lon)*math.cos((lat + lat_d) / 2)
  10. y = lat_d - lat
  11. d = math.sqrt(x**2 + y**2) * 6371
  12. # 4- lon
  13. #5- lat
  14. print(d, file=sys.stderr)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement