Java tutorial
//package com.java2s; /** * @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)); } }