I'm trying to create two sine waves A and B such that all A[x] is equidistant to B[x].
Adding a constant to the second equation does not work:
graph sin(x) and sin(x)+0.5
The distance between the diagonal lines seem similar, but the crest and troughs are different.
Adding another wave function seems to get closer, but still not exact:
graph y=sin(x) and y=sin(x)+0.2cos^2(x)+0.5
Okay so it seems like there's no such wave that can fit the my description, so I'm wondering how I would calculate B[x] given A[x].
In my comment below I know how to create the second wave, but I'm unsure how to obtain a point on B given x.
Best Answer
What you are seeking are parallel curves to $y=\sin x$.
In general, for a curve given parametrically by $x=f(t), y=g(t)$, one parallel curve a distance $a$ from it is given by $$ x= f(t)+\frac{ag'(t)}{\sqrt {{f'(t)}^2+{g'(t)}^2}} \\ y=g(t)-\frac{af'(t)}{\sqrt {{f'(t)}^2+{g'(t)}^2}}. $$ The other parallel curve at this distance is given by taking $-a$.
For the sine curve $x=t, y=\sin t$, these give $$ x(t)=t+\frac{a \cos t}{\sqrt{1+\cos^2 t}},\,y(t)=\sin t + \frac{1}{\sqrt{1+\cos^2 t}}. $$ For small $a$, you get a curve similar to a sine curve. Here is $y=\sin x$ with its parallel curves for $a=\frac{1}{2}$.
For larger $a$, the curve gets weirder, like this, with $a=2$: