By dividing within the cosine function (e.g. cos(x/3)) you can increase the wavelength between the waves, but I don't think there's any way you'll get anything near as drastic as what you've drawn there. The second drawing looks more like a square wave than a sine wave.

What you're trying to get isn't really lengthening the wavelength either. It's more like stunting the apex of the sin wave.

#2 Jan 19 2012, 7:33 pm (Edited on Jan 19 2012, 8:39 pm)

One option is taking an odd root of the function. Cubing for example would tend to pull values close to 1 farther away from 1, whereas you want to push values away from 0, so a cube root could do the trick. (You might need some special logic to account for the 0 case, possibly also the negative cases, depending on how the math is implemented.)

Another option is to feed one sine wave into another. sin(x + sin(2x)/2) produces some fatter peaks.

#4 Jan 20 2012, 12:07 pm (Edited on Jan 20 2012, 12:31 pm)

To generate the functions in my post, take a sigmoid -1<=s(x)<=1 where roughly f(0)=0, f(1)=1, f(-1)=-1, and feed cos(x) to it to get the function s(cos(x)). This works because f(cos(x)) would 'stay' at the 1 or -1 when cos(x) is close to 1 or -1 respectively, and rapidly approach 0 as cos(x) approaches 0.

Incidentally you can take apart the function sin(x+sin(2x)/2) in the same way; sin(x+sin(2x)/2)=sin(x+sin(x)cos(x)), which is f(sin(x)) for f(x)=sin(arcsin(x)+x*cos(arcsin(x)) - a nice sigmoid in -1 to 1.

What you're trying to get isn't really lengthening the wavelength either. It's more like stunting the apex of the sin wave.