@@ -0,0 +1,1262 @@
+package by.vorokhobko.3_conditional_operator;%0A/**%0A * Triangle.%0A *%0A * Class Triangle calculate the area of the triangle part 001, lesson 3.%0A * @author Evgeny Vorokhobko (vorokhobko2011@yandex.ru).%0A * @since 05.12.2016.%0A * @version 4.%0A */%0Apublic class Triangle %7B%0A /**%0A * The class field.%0A * %D0%A1reating point of a triangle a.%0A */%0A%09private Point a;%0A /**%0A * %D0%A1reating point of a triangle b.%0A */%0A%09private Point b;%0A /**%0A * %D0%A1reating point of a triangle c.%0A */%0A%09private Point c;%0A /**%0A * The constructor of the Triangle with the designation points.%0A * @param a - a.%0A * @param b - b.%0A * @param c - c.%0A */%0A%09public Triangle(Point a, Point b, Point c) %7B%0A%09%09this.a = a;%0A%09%09this.b = b;%0A%09%09this.c = c;%0A%09%7D%0A /**%0A * %D0%A1alculate the area.%0A * @return tag.%0A */%0A%09public double area() %7B%0A%09%09double lineAB = a.distanceTo(b);%0A%09%09double lineAC = a.distanceTo(c);%0A%09%09double lineBC = b.distanceTo(c);%0A%09%09double numberOfPperimeter = 2;%0A%09%09if ((lineAB %3C (lineAC + lineBC)) && (lineAC %3C (lineAB + lineBC)) && (lineBC %3C (lineAB + lineAC))) %7B%0A%09%09%09double pperimeter = (lineAB + lineAC + lineBC) / numberOfPperimeter;%0A%09%09%09return Math.sqrt(pperimeter * (pperimeter - lineAB) * (pperimeter - lineAC) * (pperimeter - lineBC));%0A%09%09%7D else %7B%0A%09%09%09throw new ArithmeticException(%22The triangle cannot be constructed%22);%0A%09%09%7D%0A%09%7D%0A%7D

add class Triangle