From db96480f6d51c7c59d64b4504d1c186cded99c79 Mon Sep 17 00:00:00 2001 From: artem30801 <38689676+artem30801@users.noreply.github.com> Date: Thu, 16 Apr 2020 22:18:41 +0300 Subject: [PATCH] Server: Fixed distance checking --- Server/copter_table_models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Server/copter_table_models.py b/Server/copter_table_models.py index 72bad16..5af3894 100644 --- a/Server/copter_table_models.py +++ b/Server/copter_table_models.py @@ -165,7 +165,7 @@ def get_position(position): def get_distance(pos1, pos2): # todo as common function if any(math.isnan(x) for x in pos1 + pos2): return float('nan') - return math.sqrt(sum(map(lambda p: p[0] - p[1], zip(pos1, pos2))) ** 2) # point distance formula + return math.sqrt(sum(map(lambda p: (p[0] - p[1]) ** 2, zip(pos1, pos2)))) # point distance formula class CopterData: