 import java.awt.*;
import java.applet.Applet;
//
public class Sierpinski extends Applet { 
//
//
// Hier ein Unterprogramm 
//
//
public void triangle(Graphics g, Point a, Point b, Point c){
//
//
//
//
// In das uebergebende Dreieck der Punkte a, b, c wird ein auf dem
// Kopf stehendes eingetragen. Die Punkte a, b, c sind offensichtlich
// Elemente einer Klasse mit Instanzvariablen x und y.
//
//
int xCoords[] = {c.x, (c.x + b.x)/2, (a.x+c.x)/2};
int yCoords[] = {b.y, (c.y+a.y)/2, (c.y + a.y)/2};
//
g.drawPolygon(xCoords, yCoords, 3); }
//
// Hier das Hauptprogramm.
// 
   
    public  void paint (Graphics g){
        int xCoords[] = {210, 590, 400};
        int yCoords[] = {490, 490,  110};
	g.drawPolygon(xCoords, yCoords, 3);
//
//
//      Jetzt der Aufruf.
//       
        triangle(g, new Point(210, 490), new Point(590,490), new Point(400,110));
	     	
	}
}
