private double eucDistance( double[] a, double[] b) {
        
        double sumDSquared = 0.0;
        
        int n = a.length;
        for(int i = 0; i < n; i++) {
            sumDSquared += (a[i]-b[i])*(a[i]-b[i]);
        }
        
        return Math.sqrt(sumDSquared);
    }