/** * <code>length</code> calculates the magnitude of this vector. * * @return the length or magnitude of the vector. */ public float length() { return FastMath.sqrt(lengthSquared()); }
public Vector4f project(Vector4f other){ float n = this.dot(other); // A . B float d = other.lengthSquared(); // |B|^2 return new Vector4f(other).multLocal(n/d); }
/** * <code>length</code> calculates the magnitude of this vector. * * @return the length or magnitude of the vector. */ public float length() { return FastMath.sqrt(lengthSquared()); }
/** * <code>length</code> calculates the magnitude of this vector. * * @return the length or magnitude of the vector. */ public float length() { return FastMath.sqrt(lengthSquared()); }
public Vector4f project(Vector4f other){ float n = this.dot(other); // A . B float d = other.lengthSquared(); // |B|^2 return new Vector4f(other).multLocal(n/d); }
public Vector4f project(Vector4f other){ float n = this.dot(other); // A . B float d = other.lengthSquared(); // |B|^2 return new Vector4f(other).normalizeLocal().multLocal(n/d); }