Finding Δt for a Bezier curve following a certain speed

19 Views Asked by At

I'm writing an algorithm where I would like a body to move along a Bezier curve at variable speed.

My bezier curve

So I have a Bezier curve which represents a body's X and Y positions over time. Because it's a bezier curve the actual "time" is just a t value between 0 and 1.

The speed function

I have another function called a speed curve, it's another Bezier curve but it could be anything (sum of sines, quadratic, cubic, etc.) which I'm using to get the desired speed at the same t value. The details of how I get an actual speed from the Y of that function are irrelevant, it should just be known that they use the same t value and that when that function is rising, my body should accelerate.

What I'm struggling with is the following: Given a fixed time step in milliseconds, the speed that was computed for the current t, and an rough estimation of the length of the curve called L

How do I calculate the Δt that represents a jump of position which corresponds to a distance of timestep * speed ?

I've tried many things, the last of which is $$ \frac{speed * timestep}{L} $$

but I end up with a mismatching velocity curve

Velocity curve