public static Vector FindTranslationToCenter(this Rect rect, Size size) { var rectMid = rect.MidPoint(); var sizeMid = size.MidPoint(); return sizeMid - rectMid; }