Here you can find the source of vectorNorm(float[] v)
Parameter | Description |
---|
public static float vectorNorm(float[] v)
//package com.java2s; public class Main { /**//from w ww. jav a 2 s . c o m * Calculate the norm of a vector * * @param v, a float vector * @return norm */ public static float vectorNorm(float[] v) { float result = 0; for (float aV : v) { result += aV * aV; } result = (float) Math.sqrt(result); return result; } }