/**
 * FractalApplet.java
 * Kim Bruce 9/4/99.  Last modified 11/4/99
 * (c) 1999 Williams College
 */
import objectdraw.*;
import java.awt.*;


// Applet to build fractal "star" picture
public class LivingFractal extends WindowController
{

        public static final double PI = 3.14159;                        // The number Pi
        public static final int limit = 10;                                                // Size at which stop pushing line into fractal
          public static final double size = 200.0;                        // Size of lines in original triangle
        public static final double startX = 100.0;                // Starting coordinates of lower left corner
        public static final double startY = 150.0;                // of triangle

          // Initializes the applet by creating the triangle with three "PushLine"s.
          public void begin(){

                PushLine line1 = new PushLine(new Location(startX,startY),size,0,limit,canvas);
            Location dest = line1.getDest();
            PushLine line2 = new PushLine(dest,size,4*PI/3,limit,canvas);
            PushLine line3 = new PushLine(line2.getDest(),size,2*PI/3,limit,canvas);
          }

          // draw again when we enter the window
          public void onMouseEnter(Location point) {
              canvas.clear();
              begin();
          }
          
}



