# Math Help - Simplifying Trig Equation (like Wolfram|Alpha does it…)

1. ## Simplifying Trig Equation (like Wolfram|Alpha does it…)

I have the equation $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 $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):

2. $sin \left ( \frac{2 \pi}{3} \theta - \frac{\pi}{6} \right ) = -cos \left ( \left [ \frac{2 pi}{3} - \frac{ \pi}{6} \right ] + \frac{ \pi}{2} \right )$

Try it from there.

-Dan

3. ## Cheers

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:
$2y = 1 +sin(\pi(x-\frac{1}{2}))$

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.