/** * Calculate the angle between two vectors, in radians * @param a A vector * @param b The other vector * @return the angle between the two vectors, in radians */ public static float angle(Vector4f a, Vector4f b) { float dls = dot(a, b) / (a.length() * b.length()); if (dls < -1f) dls = -1f; else if (dls > 1.0f) dls = 1.0f; return (float)Math.acos(dls); }