Skip to content

Instantly share code, notes, and snippets.

View Zebreu's full-sized avatar

Sébastien Ouellet Zebreu

View GitHub Profile
@Zebreu
Zebreu / index.html
Created May 26, 2012 03:20 — forked from alaingilbert/index.html
Object follow a bezier curve
<!doctype html>
<html>
<head>
</head>
<body>
<canvas id="canvas" width="800" height="600"></canvas>
<script type="text/javascript">
var ctx = document.getElementById('canvas').getContext('2d')
def rec(newPts, pts, t):
if len(pts) >= 2:
newPts.append('%s%s' % (pts[0], pts[1]))
pts.pop(0)
rec(newPts, pts, t)
def bez(pts, t):
number = len(pts)-1
newPts = []
rec(newPts, pts, t)