I’m working on a conversion matrix for a map application I’m currently writing.
I have a point in screen coordinates and the points in the target coordinate space, and for some stupid reason I cannot seem to figure out how to find the conversion matrix the converts the points in my screen coordinates to the world coordinates.
For example:
Coordinate (1005.758, 673.661) should be converted to (786382.6, 2961730.3)
and coordinate (1010.240, 665.217) should be converted to (786488.3, 2961837). I’m using WPF so that’s why the screen coordinates are actually double and not int.
With two coordinates you can extract scaling factor and translation (if the map is using these two operations only).
Scaling in the first dimension is given by
and in the second via
while the corresponding offsets are
and
Thus your transformation is given by