Dot() public static method

Peform the dot product on two vectors.
public static Dot ( Vec2 a, Vec2 b ) : float
a Vec2
b Vec2
return float
Esempio n. 1
0
File: Math.cs Progetto: vb0067/LGame
 /// <summary>
 /// Multiply a matrix transpose times a vector. If a rotation matrix is provided,
 /// then this transforms the vector from one frame to another (inverse transform).
 /// </summary>
 public static Vec2 MulT(Mat22 A, Vec2 v)
 {
     return(new Vec2(Vec2.Dot(v, A.Col1), Vec2.Dot(v, A.Col2)));
 }
Esempio n. 2
0
        public static float DistanceSquared(Vec2 a, Vec2 b)
        {
            Vec2 c = a - b;

            return(Vec2.Dot(c, c));
        }
Esempio n. 3
0
        public static float DistanceSquared(Vec2 a, Vec2 b)
        {
            Vec2 vec = a - b;

            return(Vec2.Dot(vec, vec));
        }