Java tutorial
//package com.java2s; //License from project: Apache License import java.awt.*; public class Main { public static double getDistance(Point p1, Point p2) { double x = p1.getX() - p2.getX(); double y = p1.getY() - p2.getY(); return Math.sqrt(x * x + y * y); } }