Vector.Dot
EbiseLutica opened this issue · comments
Ebise Lutica commented
ドット積を実装する
public struct Vector
{
public static float Dot(Vector v1, Vector v2) => v1.X * v1.Y + v2.X * v2.Y;
public float Dot(Vector v) => Vector.Dot(this, v);
}
public struct VectorInt
{
public static int Dot(VectorInt v1, VectorInt v2) => v1.X * v1.Y + v2.X * v2.Y;
public int Dot(VectorInt v) => VectorInt.Dot(this, v);
}