/** * Convert to a unit vector * @param vec */ public static void normalizeVector(double[] vec) { double len = vectorLength(vec); for (int i = 0; i < vec.length; i++) vec[i] /= len; }
/** * Convert to a unit vector * @param vec */ public static void normalizeVector(double[] vec) { double len = vectorLength(vec); for (int i = 0; i < vec.length; i++) vec[i] /= len; }