Java tutorial
//package com.java2s; public class Main { public static float manhattanDistance(float x1, float y1, float x2, float y2) { return Math.abs(x1 - x2) + Math.abs(y1 - y2); } }