package ru.agrin;

public class Triangle {
    public Point a;
    public Point b;
    public Point c;

    public Triangle(Point a, Point b, Point c) {
        this.a = a;
        this.b = b;
        this.c = c;
    }

    public double area() {
        //calculate the triangle area
        double result = 0.0;
	
        boolean ax = a.x != b.x && a.x != c.x;
        boolean bx = b.x != a.x && b.x != c.x;
        boolean cx = c.x != a.x && c.x != b.x;
        boolean ay = a.y != b.y && a.y != c.y;
        boolean by = b.y != a.y && b.y != c.y;
        boolean cy = c.y != a.y && c.y != b.y;

        if (ax || bx || cx || ay || by || cy || 
	((a.distanceTo(b) < b.distanceTo(c) + c.distanceTo(a)) &&
	(b.distanceTo(c) < c.distanceTo(a) + a.distanceTo(b)) &&
	(c.distanceTo(a) < a.distanceTo(b) + b.distanceTo(c)))) {
            double sp = (a.distanceTo(b) + b.distanceTo(c) + c.distanceTo(a)) / 2.0;
            result = Math.sqrt(sp * (sp - a.distanceTo(b)) * (sp - b.distanceTo(c)) * (sp - c.distanceTo(a)));
        }
        return result;
    }
}
@@ -321,333 +321,11 @@
     
-boolean ax = a.x != b.x && a.x != c.x;%0A        boolean bx = b.x != a.x && b.x != c.x;%0A        boolean cx = c.x != a.x && c.x != b.x;%0A        boolean ay = a.y != b.y && a.y != c.y;%0A        boolean by = b.y != a.y && b.y != c.y;%0A        boolean cy = c.y != a.y && c.y != b.y;%0A%0A        if (ax %7C%7C bx %7C%7C cx %7C%7C ay %7C%7C by %7C%7C cy %7C%7C %0A%09
+if 
 ((a.
@@ -436,16 +436,16 @@
 (b)) &&%0A
+
 %09(c.dist
@@ -491,17 +491,16 @@
 eTo(c)))
-)
  %7B%0A     

delete excessive conditions in the Triangle class