Here you can find the source of distanceBetween(double x1, double y1, double x2, double y2)
public static double distanceBetween(double x1, double y1, double x2, double y2)
//package com.java2s; //License from project: Open Source License public class Main { public static double distanceBetween(double x1, double y1, double x2, double y2) { return Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)); }/*from w w w . ja va 2 s . co m*/ }