private static Vector3D GetCurrentPosteriorVector(Vector3D imagePosterior, int sourceWidth, float adjustedSourceHeight, int rotation, float scaleX, float scaleY, bool flipX, bool flipY)
{
// figure out where the posterior direction went
using (var transform = new Matrix())
{
var points = new[] {new PointF(sourceWidth*imagePosterior.X, adjustedSourceHeight*imagePosterior.Y)};
transform.Rotate(rotation);
transform.Scale(scaleX*(flipY ? -1 : 1), scaleY*(flipX ? -1 : 1));
transform.TransformPoints(points);
return new Vector3D(points[0].X, points[0].Y, 0);
}
}