diff --git a/libresvip/utils/music_math.py b/libresvip/utils/music_math.py index ad7f52f1..5963dc1b 100644 --- a/libresvip/utils/music_math.py +++ b/libresvip/utils/music_math.py @@ -204,7 +204,7 @@ def f3(t: float, d: float) -> float: @staticmethod def slope(p1: tuple[float, float], p2: tuple[float, float]) -> float: - return (p2[1] - p1[1]) / (p2[0] - p1[0]) + return (p2[1] - p1[1]) / (p2[0] - p1[0]) if p2[0] != p1[0] else math.nan def slope_at(self, point_index: int) -> float: if point_index in [0, len(self.points) - 1]: