Here you can find the source of length(double[] point)
public static double length(double[] point)
//package com.java2s; //License from project: Open Source License public class Main { public static double length(double[] point) { return Math.sqrt(stScalarProd(point, point)); }/* w w w . ja v a 2 s . c o m*/ /** * Standard Skalarprodukt to UnitMatrix. * * @param a first vector * @param b second vector * @return <a,b> */ public static double stScalarProd(double[] a, double[] b) { if (a.length != b.length) throw new IllegalArgumentException("Multiplied two Vectors of different length."); double sum = 0; for (int i = 0; i < a.length; i++) { sum += a[i] * b[i]; } return sum; } }