package ru.job4j.condition;
/**
 * Calculate area.
 *
 * @author Artem Bartenev (bartenev92@gmail.com)
 * @version $Id$
 * @since 0.1
 */
public class Triangle {
	/**
	 * a point.
     */
	private Point a;
	/**
	 * b point.
     */
	private Point b;
	/**
	 * c point.
     */
	private Point c;
	/**
	 *Triange constructor.
	 *@param a is a point
	 *@param b is b point
	 *@param c is c point
     */
	public Triangle(Point a, Point b, Point c) {
    this.a = a;
    this.b = b;
    this.c = c;
}
	/**
	 * Method for calculating sideA.
	 * @return length sideA
     */
	public double sideA() {
	return Math.sqrt((a.getX() - b.getX()) * (a.getX() - b.getX()) + (a.getY() - b.getY()) * (a.getY() - b.getY()));
	}
	/**
	 * Method for calculating sideB.
	 * @return length sideB
     */
	public double sideB() {
	return Math.sqrt((a.getX() - c.getX()) * (a.getX() - c.getX()) + (a.getY() - c.getY()) * (a.getY() - c.getY()));
	}
	/**
	 * Method for calculating sideC.
	 * @return length sideC
     */
	public double sideC() {
	return Math.sqrt((b.getX() - c.getX()) * (b.getX() - c.getX()) + (b.getY() - c.getY()) * (b.getY() - c.getY()));
	}
	/**
	 * Method for area calculation.
	 * @return area is square of triangle
     */
	public double area() {
	double p = (sideA() + sideB() + sideC()) / 2.0;
	double area = Math.sqrt(p * (p - sideA) * (p - sideB) * (p - sideC));
	if (sideA() + sideB() > sideC()) {
	return area;
	} else {
	return -1.0;
	}
}
}
@@ -525,497 +525,216 @@
 ing 
-sideA.%0A%09 * @return length sideA%0A     */%0A%09public double sideA() %7B%0A%09return Math.sqrt((a.getX() - b.getX()) * (a.getX() - b.getX()) + (a.getY() - b.getY()) * (a.getY() - b.getY()));%0A%09%7D%0A%09/**%0A%09 * Method for calculating sideB.%0A%09 * @return length sideB%0A     */%0A%09public double sideB() %7B%0A%09return Math.sqrt((a.getX() - c.getX()) * (a.getX() - c.getX()) + (a.getY() - c.getY()) * (a.getY() - c.getY()));%0A%09%7D%0A%09/**%0A%09 * Method for calculating sideC.%0A%09 * @return length sideC%0A     */%0A%09public double sideC(
+distance between points.%0A%09 * @param first is coordinates of first point%0A%09 * @param second is coordinates of second point%0A%09 * @return value of distance%0A     */%0A%09public double distance(Point first, Point second
 ) %7B%0A
@@ -752,17 +752,21 @@
 h.sqrt((
-b
+first
 .getX() 
@@ -759,33 +759,38 @@
 (first.getX() - 
-c
+second
 .getX()) * (b.ge
@@ -781,25 +781,29 @@
 .getX()) * (
-b
+first
 .getX() - c.
@@ -796,25 +796,30 @@
 st.getX() - 
-c
+second
 .getX()) + (
@@ -818,17 +818,21 @@
 X()) + (
-b
+first
 .getY() 
@@ -825,33 +825,38 @@
 (first.getY() - 
-c
+second
 .getY()) * (b.ge
@@ -851,17 +851,21 @@
 Y()) * (
-b
+first
 .getY() 
@@ -866,17 +866,22 @@
 etY() - 
-c
+second
 .getY())
@@ -1012,146 +1012,305 @@
  = (
-sideA() + sideB() + sideC()) / 2.0;%0A%09double area = Math.sqrt(p * (p - sideA) * (p - sideB) * (p - sideC));%0A%09if (sideA() + sideB() %3E sideC(
+distance(this.a, this.b) + distance(this.a, this.c) + distance(this.b, this.c)) / 2.0;%0A%09double area = Math.sqrt(p * (p - distance(this.a, this.b)) * (p - distance(this.a, this.c)) * (p - distance(this.b, this.c)));%0A%09if (distance(this.a, this.b) + distance(this.a, this.c) %3E distance(this.b, this.c
 )) %7B

task's name [#189]