Here you can find the source of norm(double[] v)
public static double norm(double[] v)
//package com.java2s; //License from project: Open Source License public class Main { /** returns the norm of the vector*/ public static double norm(double[] v) { return (Math.sqrt(dotprod(v, v))); }/*from w ww . j a v a 2 s .c o m*/ /** computes the dot product v1*v2.*/ public static double dotprod(double[] v1, double[] v2) { return (v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2]); } }