Java Distance Calculate distanceSquared(int[] referenceBlock, float[] center)

Here you can find the source of distanceSquared(int[] referenceBlock, float[] center)

Description

distance Squared

License

Open Source License

Declaration

private static float distanceSquared(int[] referenceBlock,
            float[] center) 

Method Source Code

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

public class Main {
    private static float distanceSquared(int[] referenceBlock,
            float[] center) {
        float distX = referenceBlock[0] - center[0];
        float distY = referenceBlock[1] - center[1];
        float distZ = referenceBlock[2] - center[2];

        return distX * distX + distY * distY + distZ * distZ;
    }/* w ww  .j  a v  a  2 s. c om*/
}

Related

  1. distanceSquared(double x1, double y1, double x2, double y2)
  2. distanceSquared(double x1, double y1, double x2, double y2)
  3. distanceSquared(final double[] x, final double[] y)
  4. DistanceSquared(int x1, int z1, int x2, int z2)
  5. distanceSquared(int xa, int ya, int xb, int yb)
  6. distanceSquaredPointToLine(float px, float py, float x1, float y1, float x2, float y2)
  7. distanceSquaredPointToPoint(float x1, float y1, float x2, float y2)
  8. distanceSqured(int x, int y, int z, int x1, int y1, int z1)
  9. distanceSV(double[] sv1, double[] sv2)