For a signal generating software, I'm looking for a function that generates a sine-based curve but with a shifted midpoint. Usually, a sine curve looks like this:
in out slope
-------------------
0.0 pi 0 1
0.5 pi 1 0
1.0 pi 0 -1
1.5 pi -1 0
2.0 pi 0 1
I need to move the midpoint from pi to an arbitrary other value, like 0.7 pi or 1.4 pi. The quarter points should still be in the middle of their side, but if they're slightly off to make the curve "look better", that's fine, too. Example:
in out slope
-------------------
0.0 pi 0 1
0.7 pi 1 0
1.4 pi 0 -1
1.7 pi -1 0
2.0 pi 0 1
What function gives me these values?




The simplest is to define a piecewise linear function that takes the new $x$ values to the old ones. So let $$y=\begin {cases} \frac x{1.4} & x \le 1.4\pi\\\pi+\frac {x-1.4 \pi}{0.6}&1.4\pi \lt x \le 2\pi \end {cases}$$ and use $\sin (y)$