Here you can find the source of distanceBetween2Points(float vectorX0, float vectorY0, float vectorXP, float vectorYP)
public static float distanceBetween2Points(float vectorX0, float vectorY0, float vectorXP, float vectorYP)
//package com.java2s; /**/*from ww w . j a va 2 s. c om*/ * @copyright Urucas * @license Copyright (C) 2013. All rights reserved * @version Release: 1.0.0 * @link http://urucas.com * @developers Bruno Alassia, Pamela Prosperi */ public class Main { public static float distanceBetween2Points(float vectorX0, float vectorY0, float vectorXP, float vectorYP) { float x = Math.abs(vectorXP - vectorX0); float y = Math.abs(vectorYP - vectorY0); return (float) Math.sqrt((x * x) + (y * y)); } }