Here you can find the source of euclideanDistance(double x1, double y1, double x2, double y2)
public static double euclideanDistance(double x1, double y1, double x2, double y2)
//package com.java2s; //License from project: Open Source License public class Main { public static double euclideanDistance(double x1, double y1, double x2, double y2) { return Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2)); }//from w w w . j a v a2 s. c o m public static double euclideanDistance(Double[] point1, Double[] point2) { double distance = 0.0d; for (int i = 0; i < point1.length; i++) { // for (int j=0; j < point2.length; j++){ //if (i ==j){ distance += Math.sqrt(Math.pow(point1[i] - point2[i], 2)); //} //} } return distance; //Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2)); } }