示例#1
0
        public static float DistanceSquared(Vec2 a, Vec2 b)
        {
            Vec2 c = a - b;

            return(Vec2.Dot(c, c));
        }
示例#2
0
 /// <summary>
 /// Perform the cross product on two vectors. In 2D this produces a scalar.
 /// </summary>
 public static float Cross(Vec2 a, Vec2 b)
 {
     return(a.X * b.Y - a.Y * b.X);
 }
示例#3
0
        public static float Distance(Vec2 a, Vec2 b)
        {
            Vec2 c = a - b;

            return(c.Length());
        }
示例#4
0
 /// <summary>
 /// Peform the dot product on two vectors.
 /// </summary>
 public static float Dot(Vec2 a, Vec2 b)
 {
     return(a.X * b.X + a.Y * b.Y);
 }