public static double CrossMagnitudeSquared(this IVector a, IVector b) { if (a.Count != b.Count) throw new ArgumentException(); return a.LengthSquared() * b.LengthSquared() - Dot(a, b) * Dot(a, b); }
public static IVector ProjectionOnto(this IVector a, IVector b) { return b.Multiply(a.Dot(b) / b.LengthSquared()); }