Android Distance Calculate distance(int q1, int r1, int q2, int r2)

Here you can find the source of distance(int q1, int r1, int q2, int r2)

Description

distance

Declaration

public static final int distance(int q1, int r1, int q2, int r2) 

Method Source Code

//package com.java2s;

public class Main {
    public static final int distance(int q1, int r1, int q2, int r2) {
        return (Math.abs(q1 - q2) + Math.abs(r1 - r2) + Math.abs(q1 + r1
                - q2 - r2)) / 2;//from  w w w  . j a  va  2 s  . co m
    }
}

Related

  1. getDistance(double lat1, double lon1, double lat2, double lon2)
  2. dist(PointF p1, PointF p2)
  3. distanceBetweenTwoLatLongs(Location oldLocation, Location newLocation)
  4. distanceInMeters(float distance)
  5. distanceBetweenTwoPoints(double lat1, double lng1, double lat2, double lng2)
  6. KmToMiles(int distance)