A brain teaser for all mathematical educated:
You see a sine wave (green). Yellow and red are the same wave, but with, let's say, its center moved to the sides. Note that the basic conditions don't change. The peaks are still at -1 and +1, the width is still 2.
There must be a formula for this, one that allows for a variable v that alters the shape similar to the image. It should be a compact formula, so that it can be applied in realtime.
I'm trying to implement this for an audio function, not for graphics. But the principles are the same, so a formula that works on graphics would be a super start for audio optimized code.
I failed at this task, so I really hope you can help me