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

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

Description

Return the square of the distance between two points, (x1, y1) and (x2, y2).

License

Open Source License

Declaration

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

Method Source Code

//package com.java2s;

public class Main {
    /**/* ww w  .j a va  2 s . co m*/
     * Return the square of the distance between
     * two points, (x1, y1) and (x2, y2).
     */
    public static double distanceSquared(double x1, double y1, double x2, double y2) {
        return Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2);
    }
}

Related

  1. distanceSq(int x0, int y0, int x1, int y1)
  2. distanceSqr(final float[] a, final float[] b)
  3. DistanceSquareBetweenPoints(double x1, double y1, double x2, double y2)
  4. distanceSquared(double dx, double dy)
  5. distanceSquared(double x1, double y1, double x2, double y2)
  6. distanceSquared(final double[] x, final double[] y)
  7. DistanceSquared(int x1, int z1, int x2, int z2)
  8. distanceSquared(int xa, int ya, int xb, int yb)
  9. distanceSquared(int[] referenceBlock, float[] center)