From 9c1e72352fea0c5add15dd86a872ecb68a5bce1a Mon Sep 17 00:00:00 2001 From: Siarhei Siniak Date: Tue, 27 Jul 2021 10:46:07 +0300 Subject: [PATCH] [~] Refactor --- python/tasks/mlb_player.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/python/tasks/mlb_player.py b/python/tasks/mlb_player.py index 3c272da..916ad3e 100644 --- a/python/tasks/mlb_player.py +++ b/python/tasks/mlb_player.py @@ -1438,7 +1438,17 @@ def kernel_22(o_18): from math import sqrt, acos, degrees, atan, degrees ab=[a[0]-b[0],a[1]-b[1]] ab1=[c[0]-d[0],c[1]-d[1]] - cos=abs(ab[0]*ab1[0]+ab[1]*ab1[1])/(sqrt(ab[0]**2+ab[1]**2)*sqrt(ab1[0]**2+ab1[1]**2)) + cos = \ + abs( + ab[0] * ab1[0] + ab[1] * ab1[1] + ) / ( + sqrt( + ab[0] ** 2 + ab[1] ** 2 + ) * \ + sqrt( + ab1[0] ** 2 + ab1[1] ** 2 + ) + 1e-8 + ) ang = acos(cos) return ang*180/np.pi