
package ru.ematveev.point;

import java.lang.Math.*;


	public class Point {
		public double x;
		public double y;

	public Point(double x, double y) {
			this.x = x;
			this.y = y;
	}

	public double distanceTo(Point point) {
		//calculate distance between two points

				double l1 = this.x - point.x;
				double l2 = this.y - point.y;
	

				double l = Math.sqrt(Math.pow(l1, 2) + Math.pow(l2, 2));

			return l; 

	}	

}
	
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 ab = a.distanceTo(b);
				double bc = b.distanceTo(c);
				double ca = c.distanceTo(a);

				double d = (ab + bc + ca)/2;
				double s = Math.sqrt(d*(d-ab)*(d-bc)*(d-ca));

				if (s > 0)

					return s;

				else 

					return -1;
		}
			
}

public class Main{
					
	public static void main ( String[] args ){

			Point a = new Point();
			Point b = new Point();
			Point c = new Point();

			double area = new Triangle(a, b, c).area();


	}
		
}


@@ -425,699 +425,8 @@
 %7D%0A%09%0A
-public class Triangle %7B%0A%09%09%09public Point a;%0A%09%09%09public Point b;%0A%09%09%09public Point c;%0A%0A%09public Triangle(Point a, Point b, Point c) %7B%0A%09%09%09this.a = a;%0A%09%09%09this.b = b;%0A%09%09%09this.c = c;%0A%09%7D%0A%0A%09public double area() %7B%0A%09%09//calculate the triangle area%0A%0A%09%09%09%09double ab = a.distanceTo(b);%0A%09%09%09%09double bc = b.distanceTo(c);%0A%09%09%09%09double ca = c.distanceTo(a);%0A%0A%09%09%09%09double d = (ab + bc + ca)/2;%0A%09%09%09%09double s = Math.sqrt(d*(d-ab)*(d-bc)*(d-ca));%0A%0A%09%09%09%09if (s %3E 0)%0A%0A%09%09%09%09%09return s;%0A%0A%09%09%09%09else %0A%0A%09%09%09%09%09return -1;%0A%09%09%7D%0A%09%09%09%0A%7D%0A%0Apublic class Main%7B%0A%09%09%09%09%09%0A%09public static void main ( String%5B%5D args )%7B%0A%0A%09%09%09Point a = new Point();%0A%09%09%09Point b = new Point();%0A%09%09%09Point c = new Point();%0A%0A%09%09%09double area = new Triangle(a, b, c).area();%0A%0A%0A%09%7D%0A%09%09%0A%7D
+%0A%0A
 %0A%0A

change file Point.java