Java tutorial
//package com.java2s; //License from project: Apache License import android.graphics.Point; import android.graphics.PointF; public class Main { public static double pointDistance(Point a, Point b) { return Math.sqrt(Math.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2)); } public static double pointDistance(PointF a, Point b) { return Math.sqrt(Math.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2)); } public static double pointDistance(PointF a, PointF b) { return Math.sqrt(Math.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2)); } }