Here you can find the source of distBetween(float x1, float y1, float x2, float y2)
public static double distBetween(float x1, float y1, float x2, float y2)
//package com.java2s; //License from project: Open Source License public class Main { public static double distBetween(float x1, float y1, float x2, float y2) { float dx = x1 - x2; float dy = y1 - y2; double diff = Math.sqrt((dx * dx) + (dy * dy)); return diff; }/*from ww w . j av a 2s. c o m*/ }