function calculateY(t, p0y, p1y) {
    return 3*Math.pow(1-t, 2)*t*p0y + 2*(1-t)*t*t*p1y + Math.pow(t, 3);
}

var p0y = getp0y();
var p1y = getp1y();


var line;
var numLines = 256;

for (line=0; line<numLines; line++) {
    var t = line/numLines;
    fromLine = numLines*calculateY(t, p0y, p1y);
    copyLine(fromLine, line);
}
