Clarifications
Sorry for being unclear. First of all, yes, a scaling factor for amplitude would be necessary, and I have no idea why that didn't occur to me earlier. I think it was mosly because in the simpler code I wrote originally, I used the position function to generate a percentage between 0 and 1 and multiplied that by the change in position, and added it to the initial position -- which is the same thing you're suggesting here, just in a more convoluted, less broadly useful way.
Anyway, to summarize what I'm trying to do.. sinusoidals are great for smooth animation -- if you use a sinusoidal as a function that determines the position of an element, with the initial position at the trough and the final position at the next peak (or vice-versa) you get a beautifully smooth soft-start/stop. But what happens if, during a long animation of this sort, the user triggers an event, like clicking a button, etc (the setup I'm creating is part of an elaborate menu system) which changes the position the animation is moving to and/or the time it will take to arrive? At that point you need to smoothly transition to a new curve describing this new animation. (In this case, I'm ignoring what happens if a reverse of motion is needed -- once I work out slowing the animation to a stop, tacking on a new sinecurve for the reverse motion is relatively simple).
For a transition between two curves to be smooth, I remember from calc that f1(x1)=f2(x1), f1'(x1)=f2'(x1), and f1''(x1)=f2''(x1) , where x1 is the point at which the two functions transition. That's the first condition. Then, at x2, I need to specify that f2(x2) = the new position target, f2'(x2) = 0, because that should be the peak or trough of the sinewave, but f2''(x2) doesn't concern me because, so long as it reaches the position with a velocity of zero, I don't care what it was accelerating at.
so maybe a better general form would be p(t) = a * sin(bx+c) + d.
Is this impossible?
edit: I worked out a system of 5 equations with 4 unknowns that I think I should be able to solve.. someone care to sanity-check me here?
Pi = a*sin(b*Ti+c)+d
Vi = a*b*cos(b+Ti+c)
Ai = -a*b^2*sin(b+Ti+c)
Pf = a*sin(b*Tf+c)+d
0 = a*b*cos(b*Tf+c)+d
Where Pi = known initial position, Vi = known initial velocity, Ai = known initial acceleration, Ti = known initial time, Pf = known final position, and Tf = known final time. The unknowns are a, b, c, and d. Note that the velocity and acceleration functions are, of course, the 1st and 2nd derivative of the position function.
I've currently worked the two position functions around to get
sin(b*Tf+c) - sin(b*Ti+c) = (Pf-Pi)/a
by setting both equal to d, and thus equal to each other, and doing some simple arithmetic, but I forget how to use the arcsin to get rid of the sines on the left side of the equation.. again, any help appreciated.