You have made moving waves which means each point at x has a y value of sin(x - ft) (Actually this wave moves to the right) where f; is the frequency of the wave, k is the wave number. To produce standing waves you have to add two waves, one moving to the right(sin(kx - ft)) and one moving to the left(sin(kx + ft)). Now what happens is that the two waves will counter each other, producing points where there is no movement at all, called nodes. So, sin(kx - ft) + sin(kx + ft) = sin(kx)cos(ft) - sin(ft)cos(kx) + sin(kx)cos(ft) + sin(ft)cos(kx) = 2sin(kx)cos(ft).

Immediately you can see that at x = 2(pi)n/k where n is integer the amplitude of the wave is zero(node). Now, to ‘align’ the two ends(Actually what you want is to make one the opposite of the other, if you want to make them like they are in the video), you have to make their kx values differ by n(pi); where n is an odd integer so all in all what you need to do is:

1)y is calculated by y = 2sin(kx)cos(ft). You can substitute 2 with any amplitude value you like, of course.

2)Make sure that the vertex at the center of your screen has a y value calculated at a node point x = 2(pi)n/k (x = 0 is the simplest case)

3)Make the endpoint vertices so that their kx values always differ by n(pi); where n is an odd integer(1 is the simplest case but you can try higher numbers to see more periods of the wave) and linearly interpolate the x values of the vertices in between.

I hope it helps. I’m not going to say any more because this is supposed to be a project, right?