/*
 * "Grundkurs Programmieren in Java - Band 2 (2. Auflage, 2006)I"
 * 2003-2006, Carl Hanser Verlag
 * Loesungsvorschlag zu Aufgabe 9.3 (Version 2.0)
 * (c) 2003-2006 D. Ratz, J. Scheffler, D. Seese, J. Wiesenberger
 *
 */

import java.awt.*;

public class Dreieck implements GeoObjekt {

  private   Strecke s1, s2, s3;
  protected Punkt   p1, p2, p3;

  public Dreieck(Punkt p1, Punkt p2, Punkt p3) {
    this.p1 = p1;
    this.p2 = p2;
    this.p3 = p3;
    s1 = new Strecke(p1, p2);
    s2 = new Strecke(p2, p3);
    s3 = new Strecke(p3, p1);
  }
  
  public void drehen(double phi) {
    s1.drehen(phi);
    s2.drehen(phi);
    s3.drehen(phi);
  }
  
  public void zeichnen(Graphics g, int xNull, int yNull) {
    s1.zeichnen(g, xNull, yNull);
    s2.zeichnen(g, xNull, yNull);
    s3.zeichnen(g, xNull, yNull);
  }
} 
