Sin Waves

Hey,

I’m trying to get basic sin functionality and I’m having some troubles. It looks fine for P1 (you’ll see what I mean) in combination with M1-5 or S1-5. P1/S5/M5 looks nice. Most of the other combinations look nice too. Theres a few that don’t look correct though, like P2/S2/M1-5, because if you move S1-5 you notice this one is out of place. It’s period looks much larger in this one than in the rest, and it should be smaller.

The only thing I can see wrong in my math is when you increase the period, the wave is suppose to get horizontally larger, but mine gets horizontally smaller.

I was hoping someone could help if they see a problem, or point me to some sinusoidal wave programming links? (prefably in Flash)

Thanks a bunch!

EDIT: Sorry, swf isn’t showing the data.
EDIT: It does tan too, P1/S5/M5 looks kinda cool.

In the equation of a sinusoidal function:

f(t) = Asin(B(t - C)) + D

B = 2pi / period

You are confusing the period of the function and the value of B. Period is the number of cycles the function makes within the full rotation around an arc of the unit circle. As period increases, B decreases and wave length decreases.

Hope this helps :hugegrin:

Hey, thanks TheCanadian. I’ve been trying everything, and I think it’s better now even though it doesn’t look like it. I’ve just got one more problem: The waves should be straight zigzags, y going from 0, to 1, to 0, to -1, to 0, to 1, and so on. However, all the y values have odd numbers, and you can see it on the wave. I don’t know what I’m doing wrong. I removed all scaling and size modifications, and with just the basic function it doesn’t work right.

Could you check out M5/S1/P1, see that flat-top hill shouldn’t be there. I’ll post the fla, the logic is a little bit cleaner now.

Even with period at 2*Math.PI/num, no good.