Created
July 19, 2016 07:16
-
-
Save doxas/e0c842996f1ea83b7c19dc7f30fc949a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function bezier(t, p0, p1, p2, p3){ | |
var x = (1 - t) * (1 - t) * (1 - t) * p0[0] + | |
3 * (1 - t) * (1 - t) * t * p1[0] + | |
3 * (1 - t) * t * t * p2[0] + | |
t * t * t * p3[0]; | |
var y = (1 - t) * (1 - t) * (1 - t) * p0[1] + | |
3 * (1 - t) * (1 - t) * t * p1[1] + | |
3 * (1 - t) * t * t * p2[1] + | |
t * t * t * p3[1]; | |
return [x, y]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment