Here you can find the source of dist(PointF p1, PointF p2)
public static float dist(PointF p1, PointF p2)
//package com.java2s; import android.graphics.PointF; public class Main { public static float dist(PointF p1, PointF p2) { float dist = (float) Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2)); return dist; }/*from w w w . j av a 2 s. c o m*/ }