Here you can find the source of distBetweenSq(double x1, double y1, double z1, double x2, double y2, double z2)
public static double distBetweenSq(double x1, double y1, double z1, double x2, double y2, double z2)
//package com.java2s; //License from project: GNU General Public License public class Main { public static double distBetweenSq(double x1, double y1, double z1, double x2, double y2, double z2) { return Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2) + Math.pow(z1 - z2, 2); }/*from www . jav a2 s . c o m*/ }