Here you can find the source of euclideanDist(float[] v1, float[] v2)
public static double euclideanDist(float[] v1, float[] v2)
//package com.java2s; //License from project: Open Source License public class Main { public static double euclideanDist(float[] v1, float[] v2) { float dist = 0; for (int i = 0; i < Math.min(v1.length, v2.length); ++i) { dist += (v1[i] - v2[i]) * (v1[i] - v2[i]); }/*from w ww .j a v a 2 s . c o m*/ return Math.sqrt(dist); } }