public class Trikotnik extends Lik {
    double x2, y2; // drugo oglisce
    double x3, y3; // tretje oglisce

    Trikotnik(double x, double y,
		     double x2, double y2,
		     double x3, double y3) {
	super(x, y);
	this.x2 = x2; this.y2 = y2;
	this.x3 = x3; this.y3 = y3;
    }

    public double ploscina() {
	return 0.5 * Math.abs(x3*y - x2*y + x*y2 -  x3*y2 - x*y3 + x2*y3);
    }
}
