Here you can find the source of distanceBetweenPoints(double ax, double ay, double bx, double by)
public static double distanceBetweenPoints(double ax, double ay, double bx, double by)
//package com.java2s; //License from project: Apache License public class Main { public static double distanceBetweenPoints(double ax, double ay, double bx, double by) { return Math.sqrt(Math.pow((float) (bx - ax), 2) + Math.pow((float) (by - ay), 2)); }/*ww w . ja v a 2 s . co m*/ }