Fix interpolation

This commit is contained in:
Andras Schmelczer 2024-06-16 20:50:42 +01:00
parent 8bc329293b
commit e6c0b3d2d9
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C

View file

@ -9,8 +9,6 @@ INTERPOLATION_TYPE = Literal["cubic", "linear"]
def interpolate(
control_points: List[float], t: float, type: INTERPOLATION_TYPE
) -> float:
control_points = sorted(control_points)
if type == "cubic":
x = np.linspace(0, 1, len(control_points))
cs = CubicSpline(x, control_points)