package ru.job4j.condition;

/**
 * Triangle.
 *
 * @author Aleks Sidorenko (alek.siadorenko1979@gmail.com)
 * @version $Id$
 * @since 0.1
 */
public class Triangle {
	/**
	 *An object Point a.
	 */
    private Point a;
	/**
	 *An object Point b.
	 */
	private Point b;
	/**
	 *An object Point c.
	 */
	private Point c;
	/**
	 *Constructor.
	 *@param a - Point coordinate.
	 *@param b - Point coordinate.
	 *@param c - Point coordinate.
	 */
	public Triangle(Point a, Point b, Point c) {
		this.a = a;
		this.b = b;
		this.c = c;
		}
    /**
	 *Method area.
	 *Gerone formula.
	 *ab - Triangle side.
	 *bc - Triangle side.
	 *ac - Triangle side.
	 *p - Semiperimeter.
	 *@return Area Of A Triangle.
	 */
    public double area() {
		double ab = Math.sqrt(Math.pow(a.getX() - b.getX(), 2) + Math.pow(a.getY() - b.getY(), 2));
        double ac = Math.sqrt(Math.pow(a.getX() - c.getX(), 2) + Math.pow(a.getY() - c.getY(), 2));
        double bc = Math.sqrt(Math.pow(b.getX() - c.getX(), 2) + Math.pow(b.getY() - c.getY(), 2));
        double p = (ab + ac + bc) / 2;
        if (((ab + bc) <= ac) || ((ab + ac) <= bc) || ((ac + bc) <= ab) || ((ab - bc) >= ac) || ((ab - ac) >= bc) || ((bc - ac) >= ab)) {
            return -1;
        } else if ((ab == 0) || (bc == 0) || (ac == 0)) {
            return 0;
        } else {
            return Math.sqrt(p * (p - ab) * (p - ac) * (p - bc));
        }
    }
}
@@ -549,122 +549,117 @@
 hod 
-area.%0A%09 *Gerone formula.%0A%09 *ab - Triangle side.%0A%09 *bc - Triangle side.%0A%09 *ac - Triangle side.%0A%09 *p - Semiperime
+Length of Side of Triangle.%0A%09 *Gerone formula.%0A%09 *@param x - Point coordinate.%0A%09 *@param y - Point coordina
 te
-r
 .%0A%09 
@@ -671,25 +671,21 @@
 urn 
-Area Of A Triangl
+Length of Sid
 e.%0A%09
@@ -710,130 +710,61 @@
 ble 
-area() %7B%0A%09%09double ab = Math.sqrt(Math.pow(a.getX() - b.getX(), 2) + Math.pow(a.getY() - b.getY(), 2));%0A        double ac =
+lengthSideTriangle(Point x, Point y) %7B%0A        return
  Mat
@@ -775,25 +775,25 @@
 rt(Math.pow(
-a
+x
 .getX() - c.
@@ -782,33 +782,33 @@
 .pow(x.getX() - 
-c
+y
 .getX(), 2) + Ma
@@ -814,17 +814,17 @@
 ath.pow(
-a
+x
 .getY() 
@@ -817,33 +817,33 @@
 .pow(x.getY() - 
-c
+y
 .getY(), 2));%0A  
@@ -848,405 +848,288 @@
     
-    double bc = Math.sqrt(Math.pow(b.getX() - c.getX(), 2) + Math.pow(b.getY() - c.getY(), 2));%0A        double p = (ab + ac + bc) / 2;%0A        if (((ab + bc) %3C= ac) %7C%7C ((ab + ac) %3C= bc) %7C%7C ((ac + bc) %3C= ab) %7C%7C ((ab - bc) %3E= ac) %7C%7C ((ab - ac) %3E= bc) %7C%7C ((bc - ac) %3E= ab)) %7B%0A            return -1;%0A        %7D else if ((ab == 0) %7C%7C (bc == 0) %7C%7C (ac == 0)) %7B%0A            return 0;%0A        %7D else %7B%0A    
+%7D%0A%09/**%0A%09 *Method Area.%0A%09 *Gerone formula.%0A%09 *@return area of triangle.%0A%09 */%0A    public double area() %7B%0A        double ab = lengthSideTriangle(a, b);%0A        double ac = lengthSideTriangle(a, c);%0A        double bc = lengthSideTriangle(b, c);%0A        double p = (ab + ac + bc) / 2;%0A
     
@@ -1190,18 +1190,8 @@
 ));%0A
-        %7D%0A
     

task 9461