Here you can find the source of squareDist31TileMetric(int x1, int y1, int x2, int y2)
public static double squareDist31TileMetric(int x1, int y1, int x2, int y2)
//package com.java2s; //License from project: Open Source License public class Main { public static double squareDist31TileMetric(int x1, int y1, int x2, int y2) { // translate into meters double dy = convert31YToMeters(y1, y2); double dx = convert31XToMeters(x1, x2); return dx * dx + dy * dy; }//ww w .j a v a 2 s.co m public static double convert31YToMeters(double y1, double y2) { // translate into meters return (y1 - y2) * 0.01863d; } public static double convert31XToMeters(double x1, double x2) { // translate into meters return (x1 - x2) * 0.011d; } }