Here you can find the source of getDistance(double aX, double aY, double bX, double bY)
public static double getDistance(double aX, double aY, double bX, double bY)
//package com.java2s; //License from project: Open Source License import java.awt.geom.Point2D; public class Main { public static double getDistance(double aX, double aY, double bX, double bY) { return Math.abs(Math.sqrt(Math.pow(aX - bX, 2) + Math.pow(aY - bY, 2))); }// ww w . jav a 2 s . c o m public static double getDistance(Point2D.Double a, Point2D.Double b) { return getDistance(a.x, a.y, b.x, b.y); } }