Answer:
static double distance(double p1x, double p1y, double p2x, double p2y){
// distance = sqrt(x2-x1)^2+(y2-y1)^2
double xcord = Math.pow((p2x-p1x),2);
double ycord = Math.pow((p2y-p1y),2);
double distance = Math.sqrt(xcord+ycord);
return distance;
}
Explanation: