Here you can find the source of distance(Point2D a, Point2D b)
public static double distance(Point2D a, Point2D b)
//package com.java2s; //License from project: Apache License import java.awt.geom.Point2D; public class Main { public static double distance(Point2D a, Point2D b) { return a.distance(b); }//from ww w . jav a 2s .c o m }