Java Distance Calculate distanceAbs(final int a, final int b)

Here you can find the source of distanceAbs(final int a, final int b)

Description

distance Abs

License

Open Source License

Declaration

public static int distanceAbs(final int a, final int b) 

Method Source Code

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

public class Main {
    public static int distanceAbs(final int a, final int b) {
        return a > b ? a - b : b - a;
    }//from   w  w  w  . ja  v a  2  s.  c o  m

    public static float distanceAbs(final float a, final float b) {
        return a > b ? a - b : b - a;
    }
}

Related

  1. distance3Sq(double x1, double y1, double z1, double x2, double y2, double z2)
  2. distance_Sphere(double rlon1, double rlat1, double rlon2, double rlat2)
  3. distance_to_endpoint(int x1, int y1, int x2, int y2, int x, int y)
  4. distance_to_endpoint(int x1, int y1, int x2, int y2, int x, int y)
  5. distance_to_line(double x1, double y1, double x2, double y2, double x3, double y3)
  6. distanceBase(double[] coord1, double[] coord2, int order)
  7. distanceBetween(double latitude1, double longitude1, double latitude2, double longitude2)
  8. distanceBetween(double lon, double lat, double otherLon, double otherLat)
  9. distanceBetween(double startLatitude, double startLongitude, double endLatitude, double endLongitude)