squashed sine wave

2.3k Views Asked by At

Sinewave

I'm slightly out of my comfort zone with this one. I need to produce a function for use in an animation, but a sine wave isn't quite right. I tried adding a square wave, but that didn't work either. What think I need is a "squashed" sine wave, or one that is compressed, similar to the blue line in the image above, could anybody tell me what the formula is that I need?

Addition: I need the formula to be a drop-in replacement for sin(x), having the same period and amplitude.

2

There are 2 best solutions below

2
On BEST ANSWER

You could try $\sqrt[n]{\sin(x)}$, it should do the trick. Recommended you use odd values for $n$.

0
On

HINT

The exponent should be <1 like $$ | \cos(x)|^ {\frac14}$$ Change / define this function sign in two regions between odd multiples of $\pi/2. $ using $if$