Here you can find the source of distanceTo(final int x, final int y, final int thatx, final int thaty)
public static float distanceTo(final int x, final int y, final int thatx, final int thaty)
//package com.java2s; //License from project: Open Source License public class Main { /**/* ww w. java2s .c o m*/ * Returns the Euclidean distance between this point and that point. * * @return the Euclidean distance between this point and that point */ public static float distanceTo(final int x, final int y, final int thatx, final int thaty) { final int dx = x - thatx; final int dy = y - thaty; return (float) Math.sqrt(dx * dx + dy * dy); } }