Here you can find the source of EuclideanDistance(double xSource, double ySource, double xTarget, double yTarget)
private static final double EuclideanDistance(double xSource, double ySource, double xTarget, double yTarget)
//package com.java2s; //License from project: Open Source License public class Main { private static final double EuclideanDistance(double xSource, double ySource, double xTarget, double yTarget) { double distance = Math.sqrt(Math.pow(xTarget - xSource, 2) + Math.pow(yTarget - ySource, 2)); return distance; }/*from ww w . ja v a2s .c om*/ }