Java Distance Calculate distVector(double[] vector1, double[] vector2)

Here you can find the source of distVector(double[] vector1, double[] vector2)

Description

dist Vector

License

Open Source License

Declaration

public static double distVector(double[] vector1, double[] vector2) 

Method Source Code

//package com.java2s;
//  it under the terms of the GNU Lesser General Public License as published by

public class Main {
    public static double distVector(double[] vector1, double[] vector2) {
        int dim = vector1.length;
        double sum = 0;
        for (int n = 0; n < dim; n++) {
            sum += (vector1[n] - vector2[n]) * (vector1[n] - vector2[n]);
        }//w ww.ja v a  2s.  co  m
        return Math.sqrt(sum);
    }
}

Related

  1. distSquaredCartesian(double[] vec1, double[] vec2)
  2. distSquareVec3(final float[] v1, final float[] v2)
  3. distSymbol(int dist)
  4. distToRectNode(double[] point, double[] nodeCenter, double nodeRadius)
  5. distUndermod(double a, double b, double mod)
  6. distVincentyRAD(double lat1, double lon1, double lat2, double lon2)
  7. getDistance(double lat1, double lng1, double lat2, double lng2)
  8. sqrDistance(float x1, float y1, float x2, float y2)
  9. squaredDistance(float[] p, int a, int b)