I have the equation $\displaystyle y = \sin(\frac{2\pi}{3}\theta - \frac{\pi}{6})$ 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 $\displaystyle y = -\cos(\displaystyle{\frac{1}{3}}(2\pi\theta + \pi))$

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