4

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.

Grill
  • 43
  • I'm assuming you want the curve to be periodic and repeat? – Ethan Hunt May 20 '16 at 00:09
  • Yes, I should have said that. It should be a drop-in replacement for sin(x), just with an altered shape. I keep thinking I should be multiplying it by something, but I really have very little idea. – Grill May 20 '16 at 00:13
  • your drawing looks like $\sqrt{1-x^2}$ periodized – reuns May 20 '16 at 00:23

2 Answers2

2

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

  • I guess you meant $|\sin(x)|^a sign(\sin(x))$ with $a = 1/n$ – reuns May 20 '16 at 00:25
  • I just plugged "y=sin(x) ^ ( 1 / 3 )" into the animation and it looks pretty good, I'm quite happy with this, I would like to thank everybody for their help! – Grill May 20 '16 at 00:37
0

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$

Narasimham
  • 42,260