Here you can find the source of distance3Sq(double x1, double y1, double z1, double x2, double y2, double z2)
public static double distance3Sq(double x1, double y1, double z1, double x2, double y2, double z2)
//package com.java2s; //License from project: Apache License public class Main { public static double distance3Sq(double x1, double y1, double z1, double x2, double y2, double z2) { return (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1) + (z2 - z1) * (z2 - z1); }/*from w w w. j av a 2s .c o m*/ }