From c67fd1aa7fb5c0bc684ca8635a65e202335cb056 Mon Sep 17 00:00:00 2001 From: Djalim Simaila <DjalimS.pro@outlook.fr> Date: Wed, 19 Apr 2023 13:35:47 +0200 Subject: [PATCH] Fixed arctan calculations --- utils/math/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/utils/math/utils.py b/utils/math/utils.py index 15baf25..e30a74d 100644 --- a/utils/math/utils.py +++ b/utils/math/utils.py @@ -2,6 +2,7 @@ This module contains some utility functions for math operations. """ import numpy as np +import math def get_mean(values:list): """ @@ -41,7 +42,7 @@ def get_radius_from_x_y(xi:float, yi:float, x_mean:float, y_mean:float): :param y_mean: mean of y coordinates in the discrete range :return: radius for this point """ - return np.sqrt((xi - x_mean) ** 2 + (yi - y_mean) ** 2) + return np.sqrt(np.power((xi - x_mean), 2) + np.power((yi - y_mean), 2)) def get_mean_radius(discrete_values:list): """ @@ -92,4 +93,4 @@ def get_teta_from_x_y(xi:float, yi:float, x_mean:float, y_mean:float): :param y_mean: mean of y coordinates in the discrete range :return: teta for this point """ - return np.arctan2((yi - y_mean),(xi - x_mean)) \ No newline at end of file + return math.atan((xi - x_mean)/(yi - y_mean)) \ No newline at end of file -- GitLab