Does anybody know if theres an equation that will stretch a sine wave so that the higher up parts are shifted to the left or right? Heres a picture of what I mean:
Foruier transformation (or if possible use a modulo function) of a sawtooth function multiplied with sin(x). That's the best I can come up with but I think it's easier to create a function out of different functions and combine them so it's continous and differentiable.