Here you can find the source of length(double[] x)
public static double length(double[] x)
//package com.java2s; //License from project: Creative Commons License public class Main { public static double length(double[] x) { double len = 0; for (int index = 0; index < x.length; index++) len += x[index] * x[index];//ww w .j a v a 2s. co m return Math.sqrt(len); } }