Thread: 2.1 update
View Single Post
09/04/15, 06:45 PM   #59
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
Originally Posted by Ayantir View Post
@Map authors : Is someone motivated to write a correcting formula ?

I'm too bad in mathematics for that
Take the left-most and the right-most shard (to minimize error), compute distance in X coordinate (old_dx be their distance in old add-on data, new_dx be their current distance).
scale_x = new_dx / old_dx
offset_x = new_x - old_x * scale_x

Similarly for Y.

function translate_old_coords(x, y)
return x * scale_x + offset_x, y * scale_y + offset_y
end

Or better update the data with translated values, it would get really messy when coords change again.
  Reply With Quote