title: recursive Sierpinski triangle not recursive
body: <p>I'm doing a program for a recursive Sierpinski triangle and do not know how to change the points in arrays <code>xm[]</code> and <code>ym[]</code> in order to do this. to be more specific, when i run this program, only one outlined triangle with one blue inner triangle is drawn. any help would be greatly appreciated!</p>
  
  <pre><code>public class recursiveSierpinski {
     public static void draw(int n, double x0, double y0, double x1,
        double y1, double x2, double y2) {
        // if reach base case, method return
        if (n==0) return;
        // define array xm, ym to store x and y values of midpoints
        double [] xm = new double[3];
        double [] ym = new double[3];
  
        // assign midpoints’ values to xm and ym
        xm[0]= (x0+x1)/2;
        xm[1]= (x1+x2)/2;
        xm[2]= (x2+x0)/2;
        ym[0]= (y0+y1)/2;
        ym[1]= (y1+y2)/2;
        ym[2]= (y2+y0)/2;
  
        StdDraw.setPenColor(StdDraw.BLUE);
        StdDraw.filledPolygon(xm, ym); //this makes triangle
        xm[0]=xm[0]/2.0;
        ym[0]=ym[0]/2.0;
        xm[1]=xm[1]/2.0;
        ym[1]=ym[1]/2.0;
        xm[2]=xm[2]/2.0;
        ym[2]=ym[2]/2.0;
  
        draw(n,xm[0],ym[0],xm[1],ym[1],xm[2],ym[2]);
        draw(n,xm[1],ym[1],xm[2],ym[2],xm[0],ym[0]);
        draw(n,xm[2],ym[2],xm[0],ym[0],xm[1],ym[1]);
  
        // recursively draw the sub triangles (?)
  
  
       }
       public static void main(String[] args) {
       // N levels of recursion
       int N = Integer.parseInt(args[0]);
       // outline the triangle
       double t = Math.sqrt(3.0) / 2.0;
       StdDraw.line(0.0, 0.0, 1.0, 0.0);
       StdDraw.line(1.0, 0.0, 0.5, t);
       StdDraw.line(0.5, t, 0.0, 0.0);
       draw(N, 0.0, 0.0, 0.5, t, 1.0, 0.0);
       }
  }
  </code></pre>