|
|
| P is for Practical | |
| PerlMonks |
Re: Converting Pixels to LatLongby Moron (Curate) |
| on Feb 15, 2007 at 13:41 UTC ( [id://600204]=note: print w/replies, xml ) | Need Help?? |
|
IMO The most important module for this purpose is Math::Trig. Mercator projects from the centre of the earth onto an infinite cylinder of equatorial radius running North-South, scaling being only applicable on the projection (degrees = angles can't have scale). Longitudinal recentering means simply moving the arc difference between two arctangents whereas lateral recentering is linear. Apart from having the required tan and atan for Mercator projection work, the module also has more specific functions for the lazier mind for converting between spherical and cylindrical co-ordinates. It isn't possible for the recentering in any direction to traverse either pole but there are potential issues if suitable measures are not taken when crossing zero and the extreme lateral boundaries. This can be made transparent for latitude by converting to and from modulo 180, for example: (updated to include earth radius in mercator projection algorithm)
-M Free your mind
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||