Java Euclidean Distance euclideanDist(float[] v1, float[] v2)

Here you can find the source of euclideanDist(float[] v1, float[] v2)

Description

euclidean Dist

License

Open Source License

Declaration

public static double euclideanDist(float[] v1, float[] v2) 

Method Source Code

//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);
    }
}

Related

  1. euclidean(double[] x1, double[] x2)
  2. euclidean(double[] xvalues, double[] yvalues, int[] include)
  3. euclidean_distance(double[] vec1, double[] vec2)
  4. euclideanDist(double[] ePointOne, double[] ePoint2)
  5. euclideanDist(final double[] vec1, final double[] vec2, int n)
  6. euclideanDistance(double instance1[], double instance2[])
  7. euclideanDistance(double x1, double y1, double x2, double y2)
  8. euclideanDistance(double x1, double y1, double x2, double y2)
  9. EuclideanDistance(double xSource, double ySource, double xTarget, double yTarget)