Skip to content

Commit

Permalink
better unwrap
Browse files Browse the repository at this point in the history
  • Loading branch information
davidpagnon committed Mar 11, 2024
1 parent 9a868d8 commit 1c3ec3d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Sports2D/compute_angles.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,10 @@ def points2D_to_angles(points_list):
ux, uy = bx-ax, by-ay
vx, vy = dx-cx, dy-cy

ang = np.array(np.degrees(np.unwrap(np.arctan2(uy, ux) - np.arctan2(vy, vx))))
ang = np.arctan2(uy, ux) - np.arctan2(vy, vx)
ang_deg = np.array(np.degrees(np.unwrap(ang*2)/2))

return ang
return ang_deg


def flip_left_right_direction(df_points):
Expand Down

0 comments on commit 1c3ec3d

Please sign in to comment.