Java tutorial
//package com.java2s; public class Main { public static float distance(float x1, float y1, float x2, float y2) { float x = x2 - x1; float y = y2 - y1; return (float) Math.sqrt(x * x + y * y); } }