Here you can find the source of sqrDistance(float x1, float y1, float x2, float y2)
public static float sqrDistance(float x1, float y1, float x2, float y2)
//package com.java2s; //License from project: Apache License public class Main { public static float sqrDistance(float x1, float y1, float x2, float y2) { float dx = x1 - x2; float dy = y1 - y2; return dx * dx + dy * dy; }//from www. j av a2s.co m }