Here you can find the source of euclidean(double[] features1, double[] features2)
public static double euclidean(double[] features1, double[] features2)
//package com.java2s; //License from project: Open Source License public class Main { public static double euclidean(double[] features1, double[] features2) { double d = 0; if (features1 == null || features2 == null) { return 0; }//from w w w . ja v a2 s . c o m for (int i = 0; i < features1.length; i++) { d += (features1[i] - features2[i]) * (features1[i] - features2[i]); } return Math.sqrt(d); } }