I have done some graduate work in mathematics and you don't quite have
enough information to solve this problem -- even if you can effectively
assume that the world is flat and rectangular in shape.  From the way you
describe the problem, I think you are making these assumptions anyway and
in that rather distorted world, you just need one more piece of information
in order to solve the problem.  You need the coordinates on the world map
for one of the four corners of the United Kingdom's boundary.  To make
things easier, I will assume that you know the coordinates for the lower
left hand corner, LL(a,b). 

Since we already know that on the big map of the UK, up(x,y) is x units to
the east and y units to the north of the lower left hand corner of the map,
it is just a matter of changing these units to match the scaled down
version. To do this multiply the x cordinate by the width of the uk on the
world map and divide it by the width on the map of just the uk -- x*suw/uw.
 Do the same thing to the y coordinate like so -- y*suh/uh.  Now just move
these scaled distances on the World map starting at LL. Resulting in:

        wp(x,y) = (a + x*suw/uw, b + y*suh/uh).

Hope that helps,

Ben



At 11:20 AM 6/25/01 +0100, Lee Goddard wrote:
>Is there a perl module to....
>
>...map points in one map to a smaller area of another map (a
>scaled-down version of the former map)?
>
>Confused?  Me too.  Do we have a resident maths genius?
>Or someone with at least a basic education in the subject?
>
>This is what I've got (very little):
>
>ww is the width of the world map;
>wh is the height of the width map,
>uw is the width of the uk map,
>uh is the height of the uk map,
>suw is the width of the uk mapped on the world map
>suh is the height of the uk mapped on the world map
>up(x,y) is a point on the original, large uk map
>
>wp(x,y) should be a point within suw,suh on the world map that .
>equates to up(x,y).
>
>*ANY* help gratefully recieved: my head is spinning and it's
>only 11.20 am....
>
>Thanks in anticipation,
>Lee
>---
>Obligatory perl schmutter .sig:
>perl -e "print rand > 0.5 ? q/\\/ : q\/\ while 1"
>_______________________________________________
>Perl-Win32-Users mailing list
>[EMAIL PROTECTED]
>http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
>
>
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

Reply via email to