Java tutorial
//package com.java2s; public class Main { static int calcManhattanDistance(int x0, int y0, int x1, int y1) { final int md = Math.abs(x1 - x0) + Math.abs(y1 - y0); return md; } }