Here you can find the source of distance2points3D(double[] p1, double[] p2)
public static double distance2points3D(double[] p1, double[] p2)
//package com.java2s; //License from project: Apache License public class Main { public static double distance2points3D(double[] p1, double[] p2) { double dx = p2[0] - p1[0]; double dy = p2[1] - p1[1]; double dz = p2[2] - p1[2]; double dSq = dx * dx + dy * dy + dz * dz; return Math.sqrt(dSq); }/*from www . j a v a2s . co m*/ }