Java tutorial
//package com.java2s; import android.util.Log; public class Main { public static float distance(float x1, float y1, float x2, float y2) { Log.d("Data: ", "" + Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2))); return (float) Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)); } }