Skip to content

Instantly share code, notes, and snippets.

@Matthias1590
Created February 3, 2022 10:52
Show Gist options
  • Save Matthias1590/909d2ac9948f917310557396af171e29 to your computer and use it in GitHub Desktop.
Save Matthias1590/909d2ac9948f917310557396af171e29 to your computer and use it in GitHub Desktop.
Recursive Lerp Function
def lerp(points: List[Point], t: float) -> Point:
if len(points) == 2:
return (1 - t) * points[0] + t * points[1]
return lerp([lerp(points[:-1], t), lerp(points[1:], t)])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment