Here you can find the source of normSquareVec2(final float[] vec)
public static float normSquareVec2(final float[] vec)
//package com.java2s; public class Main { /**// w w w .java 2 s.c om * Return the squared length of a vector, a.k.a the squared <i>norm</i> or squared <i>magnitude</i> */ public static float normSquareVec2(final float[] vec) { return vec[0] * vec[0] + vec[1] * vec[1]; } /** * Return the squared length of a vector, a.k.a the squared <i>norm</i> or squared <i>magnitude</i> */ public static float normSquareVec2(final float[] vec, final int offset) { float v = vec[0 + offset]; final float r = v * v; v = vec[1 + offset]; return r + v * v; } }