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

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

Description

distance

License

Open Source License

Declaration

public static double distance(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 double distance(int xa, int ya, int xb, int yb) {
        return Math.sqrt(distanceSquared(xa, ya, xb, yb));
    }//from  w ww.  j  a  va2  s  .  c om

    public static int distanceSquared(int xa, int ya, int xb, int yb) {
        return square(xa - xb) + square(ya - yb);
    }

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

Related

  1. distance(int x, int y, int targetX, int targetY, int minDist, int[] outCoords)
  2. Distance(int X1, int X2, int Y1, int Y2)
  3. distance(int x1, int y1, int x2, int y2)
  4. distance(int x1, int y1, int x2, int y2)
  5. distance(int x1, int y1, int x2, int y2)
  6. distance(int[] a, int[] b)
  7. distance(String a, String b)
  8. distance(String coord1, String coord2, char unit)
  9. distance(String seq1, String seq2)