Created
February 3, 2022 10:52
-
-
Save Matthias1590/909d2ac9948f917310557396af171e29 to your computer and use it in GitHub Desktop.
Recursive Lerp Function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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