Java Distance Calculate DistanceSquared(int x1, int z1, int x2, int z2)

Here you can find the source of DistanceSquared(int x1, int z1, int x2, int z2)

Description

Distance Squared

License

Open Source License

Declaration

public static double DistanceSquared(int x1, int z1, int x2, int z2) 

Method Source Code

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

public class Main {
    public static double DistanceSquared(int x1, int z1, int x2, int z2) {
        return Math.pow(x2 - x1, 2) + Math.pow(z2 - z1, 2);
    }/*  w  w w  .j a v  a 2 s. c o  m*/

    public static double DistanceSquared(int x1, int z1, int y1, int x2, int z2, int y2) {
        return Math.pow(x2 - x1, 2) + Math.pow(z2 - z1, 2) + Math.pow(y2 - y1, 2);
    }
}

Related

  1. DistanceSquareBetweenPoints(double x1, double y1, double x2, double y2)
  2. distanceSquared(double dx, double dy)
  3. distanceSquared(double x1, double y1, double x2, double y2)
  4. distanceSquared(double x1, double y1, double x2, double y2)
  5. distanceSquared(final double[] x, final double[] y)
  6. distanceSquared(int xa, int ya, int xb, int yb)
  7. distanceSquared(int[] referenceBlock, float[] center)
  8. distanceSquaredPointToLine(float px, float py, float x1, float y1, float x2, float y2)
  9. distanceSquaredPointToPoint(float x1, float y1, float x2, float y2)