Results 1 to 1 of 1
Thread: Joining Two Sinecurves?
Jun 28, 2004, 08:53 #1
- Join Date
- Nov 2003
- NY, USA
- 0 Post(s)
- 0 Thread(s)
Joining Two Sinecurves?
The problem is thus: I have a function for position in one dimension as a function of time:
p(t) = yOffset + (deltaP/2) - (deltaP/2) * cos( pi*xOffset + ((pi*t)/deltaT))
which produces a smooth transition from initial position yOffset to final position yOffset + deltaP in time deltaT.
But, let's say somewhere over the course of that motion, I want to smoothly transition to a new position equation that reaches a different final point in a different elapsed time -- in my script, triggered by a user interrupting the standard animation by clicking on a button. I remember enough calc to know that I'll need to know the position, velocity, and acceleration (also know as p(t), p'(t), and p''(t) -- the equation and its' first and second derivatives) at the time when the transition occurs, and the new function will need to match all three values for that time. That's not too tricky, just a matter of solving equations.
The tricky bit is that I want to specify -two- points on the new equation -- the transition point, which will be somewhere along the curve, and the new endpoint. I totally don't remember enough math to get this right, and trial-and-error isn't getting me anywhere.
If anyone could offer suggestions or references, I'd appreciate it greatly.