Java Distance Calculate squaredistance(double[] v1, double[] v2)

Here you can find the source of squaredistance(double[] v1, double[] v2)

Description

returns distance between two points

License

Open Source License

Declaration

public static double squaredistance(double[] v1, double[] v2) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /** returns distance between two points*/
    public static double squaredistance(double[] v1, double[] v2) {
        double dx = v1[0] - v2[0];
        double dy = v1[1] - v2[1];
        double dz = v1[2] - v2[2];
        return (dx * dx + dy * dy + dz * dz);
    }/*from   ww w  .  j  av  a2 s  .  com*/
}

Related

  1. squaredDistance(float[] p, int a, int b)
  2. squaredEuclideanDistance(double[] x, double[] y)
  3. squareDist31TileMetric(int x1, int y1, int x2, int y2)
  4. squareDistance(double pointAX, double pointAY, double pointBX, double pointBY)
  5. squareDistance(double x1, double y1, double x2, double y2)
  6. squareDistance(final double[] a, final double[] b)
  7. squareLength(final float x1, final float y1, final float z1, final float x2, final float y2, final float z2)
  8. squareSegmentDistance(float[] p, int a, int b, int c)