Try it from there.
-Dan
I have the equation to produce the second curve I'm using to make a sinusoidal function that smoothly maps from 0 to 1. The range for y= needed to be [0.5, 1] and it seems to be correct.
Wolfram|Alpha tells me this is equivalent to
I looked at all the trig equations on Wikipedia to try refreshing my Trig knowledge and got enough to transpose the basic sine curve into the form I need it. I can't work out the steps to simplify my equation to the answer Wolfram|Alpha provided though.
As far as my Javascript program goes, it don't ?think one expression is going to cost any more than the other, but given the large number of times it needs to calculate the function (1000 points * 60 frames/sec) every bit counts. Any pointers gladly received! I'm interested on how a program can do that crunching to a simpler expression and how many steps it involves.
In the image below, I'm use the Orange curve function for range of x=[0, 0.5) and the Purple curve function for range x=[0.5, 1] to make a composite function.
Grapher file if you are on Mac (Grapher comes free with most versions of OS X):
Download
Oh thanks, I see that now!
After some sleep I realised I was unnecessarily combining two curves into a composite function to approximate this more simple curve:
Green curve is new simpler function!
If anybody has any experience with Grapher, i would like to know how to limit the range of a function being plotted to a sub-section of the curve. It's a pretty powerful 2D/3D animated plotter, if people haven't seen it, check it.