public float dot(double x, double y, double z, double w) { return dot((float) x, (float) y, (float) z, (float) w); }
public float dot(Vector4f v) { return dot(v.x, v.y, v.z, v.w); }
public float dot(double x, double y, double z, double w) { return dot((float) x, (float) y, (float) z, (float) w); }
public float dot(Vector4f v) { return dot(v.x, v.y, v.z, v.w); }
public Vector4f project(float x, float y, float z, float w) { final float lengthSquared = x * x + y * y + z * z + w * w; if (Math.abs(lengthSquared) < GenericMath.FLT_EPSILON) { throw new ArithmeticException("Cannot project onto the zero vector"); } final float a = dot(x, y, z, w) / lengthSquared; return new Vector4f(a * x, a * y, a * z, a * w); }
public Vector4f project(float x, float y, float z, float w) { final float lengthSquared = x * x + y * y + z * z + w * w; if (Math.abs(lengthSquared) < GenericMath.FLT_EPSILON) { throw new ArithmeticException("Cannot project onto the zero vector"); } final float a = dot(x, y, z, w) / lengthSquared; return new Vector4f(a * x, a * y, a * z, a * w); }