Here you can find the source of distanceSq(int x0, int y0, int x1, int y1)
public static int distanceSq(int x0, int y0, int x1, int y1)
//package com.java2s; // under the terms of the GNU Lesser General Public License as published public class Main { /**/*from w w w . j av a 2 s.co m*/ * Return the squared distance between the given points. */ public static int distanceSq(int x0, int y0, int x1, int y1) { return ((x1 - x0) * (x1 - x0)) + ((y1 - y0) * (y1 - y0)); } }