public static void GetScaleToIntegralTransforms( Bounds2D bounds, long maxTargetCoordinate, out Matrix4D scaleTransform, out Matrix4D inverseScaleTransform) { scaleTransform = Transformation4D.GetScaleAndTranslateTransform(bounds.Min, bounds.Max, new Point2D((double)-maxTargetCoordinate + 0.5, (double)-maxTargetCoordinate + 0.5), new Point2D((double)maxTargetCoordinate + 0.5, (double)maxTargetCoordinate + 0.5)); inverseScaleTransform = Transformation4D.GetScaleAndTranslateTransform(new Point2D((double)-maxTargetCoordinate, (double)-maxTargetCoordinate), new Point2D((double)maxTargetCoordinate, (double)maxTargetCoordinate), bounds.Min, bounds.Max); }