using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; namespace Serein.Workbench.Extension { /// /// 向量(Vector)的扩展方法 /// public static class VectorExtension { /// /// 计算两个向量的点积。 /// /// /// /// public static double DotProduct(this Vector a, Vector b) { return a.X * b.X + a.Y * b.Y; } /// /// 计算两个向量的叉积。 /// /// /// public static Vector NormalizeTo(this Vector v) { var temp = v; temp.Normalize(); return temp; } } }