Here you can find the source of distanceSquared(int xa, int ya, int xb, int yb)
public static int distanceSquared(int xa, int ya, int xb, int yb)
//package com.java2s; //License from project: Open Source License public class Main { public static int distanceSquared(int xa, int ya, int xb, int yb) { return square(xa - xb) + square(ya - yb); }/*from w ww .j av a 2s . c o m*/ public static int square(int i) { return i * i; } }