Here you can find the source of euclideanDist(double[] ePointOne, double[] ePoint2)
public static double euclideanDist(double[] ePointOne, double[] ePoint2)
//package com.java2s; //License from project: Open Source License public class Main { public static double euclideanDist(double[] ePointOne, double[] ePoint2) { double diff; int i;//from w w w . j av a 2s. c o m double eDist = 0; for (i = 0; i < ePointOne.length; i++) { if (i < ePoint2.length) { diff = ePointOne[i] - ePoint2[i]; } else { diff = 0; } eDist += (diff * diff); } eDist = Math.sqrt(eDist); return (eDist); } }