Hello everyone.
I'm working on an algorithm to smooth the animations my artist is making into our home made animation editor. By "smoothing" I mean giving the moving nodes a continuous velocity profile. So my algorithm must transform a broken velocity profile into a continuous one.
So here is the hard part.
I have a function that looks like this. This is the velocity profile I want. The variables I know are:
- sV the start velocity (not necessarily null)
- eV the end velocity (not necessarily null nor equal to sV)
- et the total time
- d the surface below the curve, that also is the distance of the move
I'm trying to use those to compute these outputs:
- mV the maximal velocity
- mt the time of the maximal velocity
The constraint is that the acceleration must equal the deceleration. In other words, both segments of the curve have the same slope (the later is just the negative of the former).
From this I could write the following equations:
- d = (((mV - sV)^2 / 2*mt^2) + sV) * mt + (((eV - mV)^2 / 2*(et - mt)^2) + mV) * (et - mt)
which can be simplified into
d = (mV - sV)^2 / 2*mt + sV*mt + (eV - mV)^2 / 2*(et - mt) + mV*et - mV*mt
This first equation is the primitive of my velocity. - (mV - sV) / mt = -(eV - mV) / (et - mt)
which is the constraint that both slope shall be equal.
So. Two unknown variables. Two equations. The last equation allow me to define one unknown variable from the other. This shall be solvable right ? Right ?
I didn't manage to solve it
When I put the equation on the paper I get something horribly long and complicated and I can't put it into a form that allow me to extract a solution. When I enter it into an equation solving program I get horribly long solutions that are unusable because they always produce division by zero.
Yet, I don't see any reason why this wouldn't be solvable. I guess I'm making a mistake here
Could someone give me a clue on this ?
Regards