Here you can find the source of squaredistance(double[] v1, double[] v2)
public static double squaredistance(double[] v1, double[] v2)
//package com.java2s; //License from project: Open Source License public class Main { /** returns distance between two points*/ public static double squaredistance(double[] v1, double[] v2) { double dx = v1[0] - v2[0]; double dy = v1[1] - v2[1]; double dz = v1[2] - v2[2]; return (dx * dx + dy * dy + dz * dz); }/*from ww w . j av a2 s . com*/ }