Here you can find the source of squareLength(final float x1, final float y1, final float z1, final float x2, final float y2, final float z2)
public static float squareLength(final float x1, final float y1, final float z1, final float x2, final float y2, final float z2)
//package com.java2s; //License from project: Apache License public class Main { public static float squareLength(final float x1, final float y1, final float z1, final float x2, final float y2, final float z2) { final float dx = x1 - x2; final float dy = y1 - y2; final float dz = z1 - z2; return dx * dx + dy * dy + dz * dz; }/*from w w w .j ava 2s .c o m*/ }