Here you can find the source of distance(double x, double y, double xx, double yy)
public static double distance(double x, double y, double xx, double yy)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from ww w. j ava 2s . c o m*/ * Calculate the Pythagorean distance from (x, y) to (xx, yy) */ public static double distance(double x, double y, double xx, double yy) { double dx = xx - x; double dy = yy - y; return Math.sqrt(dx * dx + dy * dy); } }