Here you can find the source of norm(double[] a)
Parameter | Description |
---|---|
a | vector of length 3 |
public static double norm(double[] a)
//package com.java2s; public class Main { /**/*from w ww . j ava 2 s.co m*/ * vector 2-norm * * @param a vector of length 3 * @return norm(a) */ public static double norm(double[] a) { double c = 0.0; for (double num : a) { c += num * num; } return Math.sqrt(c); } }