code: public static double getDistance(final double x1, final double x2, final double y1, final double y2) {
  		// transform to radian
  		final double deg2rad = Math.PI / 180;
  		
  		final double x1rad = x1 * deg2rad;
  		final double x2rad = x2 * deg2rad;
  		final double y1rad = y1 * deg2rad;
  		final double y2rad = y2 * deg2rad;
  		
  		// great-circle-distance with hypersine formula
  		final double dlong = x1rad - x2rad;
  		final double dlat = y1rad - y2rad;
  		final double a = Math.pow(Math.sin(dlat / 2), 2) + (Math.cos(y1rad) * Math.cos(y2rad) * Math.pow(Math.sin(dlong / 2), 2));
  		final double c = 2 * Math.asin(Math.sqrt(a));
  		
  		return GISTool.EARTH_RADIUS_KILOMETERS * c;
  	}
docs: calculates the distance between two locations, which are given as coordinates, in kilometers<br>
  the method used is the great-circle-distance with hypersine formula
  
  @param x1 - longitude of position 1
  @param x2 - longitude of position 2
  @param y1 - latitude of position 1
  @param y2 - latitude of position 2
  @return distance in kilometers