Here you can find the source of dist(float x1, float y1, float x2, float y2)
public static float dist(float x1, float y1, float x2, float y2)
//package com.java2s; //License from project: Open Source License public class Main { public static float dist(float x1, float y1, float x2, float y2) { double x = x2 - x1; double y = y2 - y1; return (float) Math.sqrt((x * x) + (y * y)); }// www. j av a 2s. co m }