Multiple Sine Waves

Hi. I think i found something that might work
I basically just added some while loops then switched the X and Y. Your code was very advanced it would take me at least a week to make that! Anyway heres my code that added more waves and vertical waves

int xspacing = 2;
int w;

float theta = 0.45;
float amplitude = 150;
float period = 900.0;
float dx;
float[] yvalues;


int waves = 3;
int repeat = 0;

void setup() {
fullScreen();
w = width+16;
dx = (TWO_PI / period) * xspacing;
yvalues = new float[w/xspacing];
}

void draw() {
background(252, 177, 3);
calcWave();
renderWave();
}

void calcWave() {
theta += 0.1;

float x = theta;
for (int i = 0; i < yvalues.length; i++) {
yvalues[i] = sin(x)*amplitude;
x+=dx;
}
}

void renderWave() {
noStroke();
fill(255);

repeat = 0;
while(repeat < waves){
for (int x = 0; x < yvalues.length; x++) {
ellipse(x*xspacing, height/2+yvalues[x] + repeat*100, 16, 16);
}
repeat = repeat +1;
}

repeat = 0;
while(repeat < waves){
for (int x = 0; x < yvalues.length; x++) {
ellipse(height/2+yvalues[x] - 200 - repeat*100, x*xspacing + 500, 16, 16);
}
repeat = repeat +1;
}

}