Java Distance Calculate distanceSquared(int xa, int ya, int xb, int yb)

Here you can find the source of distanceSquared(int xa, int ya, int xb, int yb)

Description

distance Squared

License

Open Source License

Declaration

public static int distanceSquared(int xa, int ya, int xb, int yb) 

Method Source Code

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

public class Main {
    public static int distanceSquared(int xa, int ya, int xb, int yb) {
        return square(xa - xb) + square(ya - yb);
    }/*from w  ww .j  av a 2s .  c o  m*/

    public static int square(int i) {
        return i * i;
    }
}

Related

  1. distanceSquared(double dx, double dy)
  2. distanceSquared(double x1, double y1, double x2, double y2)
  3. distanceSquared(double x1, double y1, double x2, double y2)
  4. distanceSquared(final double[] x, final double[] y)
  5. DistanceSquared(int x1, int z1, int x2, int z2)
  6. distanceSquared(int[] referenceBlock, float[] center)
  7. distanceSquaredPointToLine(float px, float py, float x1, float y1, float x2, float y2)
  8. distanceSquaredPointToPoint(float x1, float y1, float x2, float y2)
  9. distanceSqured(int x, int y, int z, int x1, int y1, int z1)