Java Distance Calculate distanceSq(int x0, int y0, int x1, int y1)

Here you can find the source of distanceSq(int x0, int y0, int x1, int y1)

Description

Return the squared distance between the given points.

License

Open Source License

Declaration

public static int distanceSq(int x0, int y0, int x1, int y1) 

Method Source Code

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

public class Main {
    /**/*from  w  w w  . j av a 2  s.co m*/
     * Return the squared distance between the given points.
     */
    public static int distanceSq(int x0, int y0, int x1, int y1) {
        return ((x1 - x0) * (x1 - x0)) + ((y1 - y0) * (y1 - y0));
    }
}

Related

  1. distances(double[][] arr, int[][] partners)
  2. distanceSq(double[] p1, double[] p2, double[] weights)
  3. distanceSQ(double[] pos1, double[] pos2)
  4. distanceSq(double[] vec1, double[] vec2)
  5. distanceSq(float x0, float y0, float x1, float y1)
  6. distanceSqr(final float[] a, final float[] b)
  7. DistanceSquareBetweenPoints(double x1, double y1, double x2, double y2)
  8. distanceSquared(double dx, double dy)
  9. distanceSquared(double x1, double y1, double x2, double y2)