import java.lang.Math;
public class Point {
double x;
double y;
Point(double x, double y) {
this.x = x;
this.y = y;
}
public static void main(String[] args) {
distance(new Point(1, 3), new Point(4, 7));
}
static void distance(Point p1, Point p2) {
double distence = (Math.hypot((p1.x - p2.x), (p1.y - p2.y)));
System.out.println(distence);
}
}
public static double distance(Point p1, Point p2){
x = p1.x - p2.x;
y = p1.y - p2.y;
dis= Math.pow(x,2)+Math.pow(y,2);
return Math.sqrt(dis);
}
public class Point {
private double x;
private double y;
public double distance(Point p1, Point p2){
return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
}
}