Here you can find the source of distSqr2(double x1, double y1, double x2, double y2)
public static double distSqr2(double x1, double y1, double x2, double y2)
//package com.java2s; //License from project: Open Source License public class Main { public static double distSqr2(double x1, double y1, double x2, double y2) { x1 -= x2;//from w w w . ja v a2 s .c o m y1 -= y2; return x1 * x1 + y1 * y1; } }