language agnostic - Finding the translation between points -


I have a map of America, and I have a lot of pixel coordinates on that map that are consistent with the locations. These dynamically form dynamically on the map on runtime according to different settings and statistics.

Now I have to switch to a different map of America, which is differently shaped, and in the top left corner of the map, in a little space in the ocean

So I have manually collected a small group of coordinates for each map that correspond to each other. For example, on the first map, the point (244,312) corresponds to the point (598,624) on the second map, and on the first map (1323,374) corresponds to another map (2793,545), etc.

So I am trying to decide the translation of X and Y dimensions. So the set of points for old and new maps was given, how do I get the x '= a * x + c and y' = B * x + D equation Automatically translate any point from the map to one point?

You have two points coordinates on both the maps, (x 1 , Y 1 ), (x ' 1 , y' 1 ), (X 2 , y 2 ) and (x ' 2 , y' 2 ).

 A = (x ' 1  - x'  2 ) / (x  1  - x  2 < / Sub>) b = (y ' 1  - y'  2 ) / (y  1  - y  2  ) C = X ' 1  - Ax  1  D = y'  1  - BY  1  

PS Your equation shows a simple scaling / translation from one map to another if you are worried about using different estimates from the world to the aircraft, the equation is more complex Will go


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -