```
class loc {
float[] x;
float[] y;
float v_o_x, v_o_y;

float[] locationx = new float[0];
float[] locationy = new float[0];

loc(float x_o, float y_o, float v_o, float theta, int t_end) {

theta = radians(theta);

v_o_x = v_o_x = v_o * cos(theta);

v_o_y = abs(v_o) * sin(theta);

for (int i=0; i<t_end; i++) {
  locationx = append(locationx, (v_o_x * i + x_o));
  locationy = append(locationy, (0.5*10*pow(i, 2) - v_o_y*i + y_o));
}

this.x = locationx;
this.y = locationy;
}
}

loc locations;

int wait = 75; // change delay between animation
int i = 0;
int j = 0;

float randV = random(-70, 70);
float randAng = random(30, 50);

int len = 17;

void setup() {

  size(1500, 800);

  background(255);
}

void draw() {

  fill(0);

  int d = 20; // diameter

  float[] xx, yy;

  if (i < len) {

    locations = new loc(width/2, height/3.5, randV, randAng, len);

    xx = locations.x;
    yy = locations.y;

    //background(255);
    rect(width/2-d, height/3.5+d, d*2, d*2);

    float s = 255/locations.x.length;
    fill((0+i*s));
    ellipse(xx[i], yy[i], d, d);

    i += 1;

    delay(wait);
  } else { 
    randV = random(-70, 70);
    randAng = random(30, 50);
    i = 0;
  }
}

```

I have a simple code written that animates the trajectory of a ball for a random initial angle and velocity. As it currently runs, it will send one ball out, wait for it to land, and then send another random ball out. My hopes are to get it to simultaneously send out multiple random balls, to create a sort of fountain effect. I have had a lot of trouble getting it to do that, any suggestions?