Here you can find the source of distanceSquared(double dx, double dy)
public static double distanceSquared(double dx, double dy)
//package com.java2s; //License from project: Open Source License public class Main { public static double distanceSquared(double dx, double dy) { return (dx * dx) + (dy * dy); }//from www .ja va 2 s .c om }