Skip to content

Instantly share code, notes, and snippets.

@ceane
Last active January 4, 2016 09:39
Show Gist options
  • Save ceane/8603091 to your computer and use it in GitHub Desktop.
Save ceane/8603091 to your computer and use it in GitHub Desktop.
Béizer curve calculations
//point as in [c1, c2]
function simpleDeCasteljau (point, t) {
return (1-t)*point[0] + t*point[1]
}
function pointInTimeOnBezier(startPoint, endPoint, time) {
return [
simpleDeCasteljau([startPoint[0], endPoint[0]], time),
simpleDeCasteljau([startPoint[1], endPoint[1]], time) ];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment