From 7971ae1907ebd1cb4b185ffd5a31c524f1c2418a Mon Sep 17 00:00:00 2001 From: Lionel GUEZ <guez@lmd.ens.fr> Date: Thu, 11 May 2023 20:54:04 +0200 Subject: [PATCH] Rename variable `lat_for_conv` to latitude --- Trajectories/cost_function.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Trajectories/cost_function.py b/Trajectories/cost_function.py index 78d3cbb9..444995d9 100755 --- a/Trajectories/cost_function.py +++ b/Trajectories/cost_function.py @@ -183,8 +183,8 @@ for edge in g.edges(): source_node = edge.source() target_node = edge.target() - lat_for_conv = math.radians((g.vp.pos_last[source_node][1] + - g.vp.pos_first[target_node][1]) / 2) + latitude = math.radians((g.vp.pos_last[source_node][1] + + g.vp.pos_first[target_node][1]) / 2) # (latitude needed for conversion of degrees to kilometers) # Because of the wrapping issue (360° wrapping incorrectly to 0°), @@ -193,7 +193,7 @@ for edge in g.edges(): - g.vp.pos_first[target_node][0]) if lon_diff > 300: lon_diff = 360 - lon_diff - Delta_Cent = math.sqrt((lon_diff * 111.32 * math.cos(lat_for_conv))**2 + Delta_Cent = math.sqrt((lon_diff * 111.32 * math.cos(latitude))**2 + ((g.vp.pos_last[source_node][1] - g.vp.pos_first[target_node][1]) * 110.574)**2) -- GitLab