/// <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))); }
public static float DistanceSquared(Vec2 a, Vec2 b) { Vec2 c = a - b; return(Vec2.Dot(c, c)); }
public static float DistanceSquared(Vec2 a, Vec2 b) { Vec2 vec = a - b; return(Vec2.Dot(vec, vec)); }