Here you can find the source of vectorLength(double[] vector)
public static double vectorLength(double[] vector)
//package com.java2s; public class Main { public static double vectorLength(double[] vector) { double sum = 0.d; for (double dd : vector) sum += dd * dd;/* ww w . j ava 2 s. c o m*/ return Math.sqrt(sum); } }