public static Vector2d Transform(Matrix2d mat, Vector2d vec) { Transform(ref mat, ref vec, out Vector2d result); return(result); }
/// <summary> /// Transform a Vector by the given Matrix using right-handed notation. /// </summary> /// <param name="mat">The desired transformation.</param> /// <param name="vec">The vector to transform.</param> /// <param name="result">The transformed vector.</param> public static void Transform(ref Matrix2d mat, ref Vector2d vec, out Vector2d result) { result.X = (mat.Row0.X * vec.X) + (mat.Row0.Y * vec.Y); result.Y = (mat.Row1.X * vec.X) + (mat.Row1.Y * vec.Y); }
/// <summary> /// Transform a Vector by the given Matrix. /// </summary> /// <param name="vec">The vector to transform.</param> /// <param name="mat">The desired transformation.</param> /// <param name="result">The transformed vector.</param> public static void Transform(ref Vector2d vec, ref Matrix2d mat, out Vector2d result) { result = new Vector2d( (vec.X * mat.Row0.X) + (vec.Y * mat.Row1.X), (vec.X * mat.Row0.Y) + (vec.Y * mat.Row1.Y)); }