package anna.cources.sandbox;

public class Distance {

    public static void main (String[] args) {
        Point p1 = new Point (5, 5);
        Point p2 = new Point(10, 10);

        System.out.println("Distance between two points is " + distance(p1, p2));
    }



    public static double distance (Point p1, Point p2) {

        double l;
        return l = Math.sqrt ((p2.x-p1.x)*(p2.x-p1.x) + (p2.y-p1.y)*(p2.y-p1.y));

    }
}



@@ -220,18 +220,64 @@
 een 
-two points
+(%22+ p1.x +%22, %22+ p1.y + %22)  and (%22+ p2.x +%22, %22+ p2.y + %22)
  is 
@@ -306,18 +306,16 @@
 %0A    %7D%0A%0A
-%0A%0A
     publ
@@ -368,26 +368,8 @@
  %7B%0A%0A
-        double l;%0A
     
@@ -382,12 +382,8 @@
 turn
- l =
  Mat
@@ -394,20 +394,16 @@
 rt (
-(p2.x-p1.x)*
+Math.pow
 (p2.
@@ -412,24 +412,22 @@
 p1.x
+,2
 ) + 
-(p2.y-p1.y)*
+Math.pow
 (p2.
@@ -432,16 +432,18 @@
 2.y-p1.y
+,2
 ));%0A%0A   

update Distance class to add variable into the message