From ea8c3a9045159f5b0719ee024b6e4ed26d8fcb38 Mon Sep 17 00:00:00 2001 From: Abigail Gold Date: Wed, 25 Dec 2019 02:52:14 -0500 Subject: [PATCH] in dent we trust --- exts/grid.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exts/grid.py b/exts/grid.py index 2f2d41b..03305ba 100644 --- a/exts/grid.py +++ b/exts/grid.py @@ -84,8 +84,8 @@ If two grid squares are given, the distance and azimuth between them is calculat d_lat = math.radians(loc2[0] - loc[0]) d_lon = math.radians(loc2[1] - loc[1]) a = math.sin(d_lat/2) ** 2 - + math.cos(math.radians(loc[0])) * math.cos(math.radians(loc2[0])) - * math.sin(d_lon/2) ** 2 + a += math.cos(math.radians(loc[0])) * math.cos(math.radians(loc2[0])) + a *= math.sin(d_lon/2) ** 2 c = 2 * math.atan2(math.sqrt(a), math.sqrt(1-a)) d = radius * c d_mi = 0.6213712 * d @@ -93,8 +93,8 @@ If two grid squares are given, the distance and azimuth between them is calculat # Bearing y_dist = math.sin(math.radians(loc2[1]-loc[1])) * math.cos(math.radians(loc2[0])) x_dist = math.cos(math.radians(loc[0])) * math.sin(math.radians(loc2[0])) - - math.sin(math.radians(loc[0])) * math.cos(math.radians(loc2[0])) - * math.cos(math.radians(loc2[1] - loc[1])) + x_dist -= math.sin(math.radians(loc[0])) * math.cos(math.radians(loc2[0])) + x_dist *= math.cos(math.radians(loc2[1] - loc[1])) bearing = (math.degrees(math.atan2(y_dist, x_dist)) + 360) % 360 embed = cmn.embed_factory(ctx)