Rename haversine to haversine_01

This commit is contained in:
2023-05-28 23:26:52 +01:00
parent 2900e508a1
commit 66aa3500d6
9 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
from math import radians, sin, cos, sqrt, asin
def haversine_of_degrees(x0, y0, x1, y1, radius):
dy = radians(y1 - y0)
dx = radians(x1 - x0)
y0 = radians(y0)
y1 = radians(y1)
root_term = (sin(dy / 2) ** 2) + cos(y0) * cos(y1) * (sin(dx / 2) ** 2)
result = 2 * radius * asin(sqrt(root_term))
return result