Last active
April 14, 2016 19:36
-
-
Save sylistine/80b9db7c0b4edcd27c7560cb342b7e63 to your computer and use it in GitHub Desktop.
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
// AKA'd as Lerp | |
// Returns the point between A and B if t is time or progress and is clamped between 0 and 1 | |
function LinearBezier(A, B, t) : float { | |
return (1-t) * A + | |
(t) * B; | |
} | |
// Querp? | |
function QuadraticBezier(A, B, C, t) : float { | |
return (1-t) * LinearBezier(A, B, t) + | |
(t) * LinearBezier(B, C, t); | |
} | |
// Curp. | |
function CubicBezier(A, B, C, D, t) : float { | |
return (1-t) * QuadraticBezier(A, B, C, t) + | |
(1) * QuadraticBezier(B, C, D, t); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment