Java Distance Calculate squareDistance(double x1, double y1, double x2, double y2)

Here you can find the source of squareDistance(double x1, double y1, double x2, double y2)

Description

Computes the distance between two points squared.

License

Open Source License

Declaration

public static double squareDistance(double x1, double y1, double x2, double y2) 

Method Source Code

//package com.java2s;

public class Main {
    /**//from   www  .j a va 2 s.com
     * Computes the distance between two points squared.
     */
    public static double squareDistance(double x1, double y1, double x2, double y2) {
        double xDiff = x1 - x2;
        double yDiff = y1 - y2;
        return xDiff * xDiff + yDiff * yDiff;
    }
}

Related

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