Here you can find the source of dist(int x1, int y1, int x2, int y2)
public static int dist(int x1, int y1, int x2, int y2)
//package com.java2s; //License from project: Apache License public class Main { public static int dist(int x1, int y1, int x2, int y2) { return (int) Math.sqrt(((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1))); }/* ww w . ja v a 2 s . c om*/ }