[Math] Moving along a bezier curve in time T, factoring in acceleration from X to Y

bezier-curve

OK, so I got my ships moving along the bezier in time T, now I need to factor in acceleration, but I don't really know how to do it.

I'm using the DeCasteljau Algorithm, that's what my code looks like:

function linp(d, a, b, t) {
    d.x = a.x + (b.x - a.x) * t;
    d.y = a.y + (b.y - a.y) * t;
}

// a, b, c, d are the 4 controls points, dest will contain the x/y coordinates and t is the time value from 0.0 to 1.0
Ship.prototype.bezier = function(dest, a, b, c, d, delta) {
    var ab = {x:0, y: 0}, bc = {x:0, y: 0}, cd = {x:0, y: 0};
    var abbc = {x:0, y: 0}, bccd = {x:0, y: 0};
    linp(ab, a, b, t);
    linp(bc, b, c, t);
    linp(cd, c, d, t);
    linp(abbc, ab, bc, t);
    linp(bccd, bc, cd, t);
    linp(dest, abbc, bccd, t);
};

So the question is, what is a simple way to factor in the acceleration from the starting speed to the end speed?

Update:
Here's a small video how the thing looks when it's not working. I hope this helps.

http://www.youtube.com/watch?v=EIJg1WFbjh4

Best Answer

OK, got it figured out my self, before including the acceleration I first had to parameterize the curve itself, you can read all the stuff over at my gamedev question:

https://gamedev.stackexchange.com/questions/5373/moving-ships-between-two-planets-along-a-bezier-missing-some-equations-for-accel

Related Question