コード例 #1
0
ファイル: VecOps.cs プロジェクト: SSheldon/veccalc
 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);
 }
コード例 #2
0
ファイル: VecOps.cs プロジェクト: SSheldon/veccalc
 public static IVector ProjectionOnto(this IVector a, IVector b)
 {
     return b.Multiply(a.Dot(b) / b.LengthSquared());
 }