source: issm/trunk-jpl/src/m/coordsystems/ll2mercator.m@ 15139

Last change on this file since 15139 was 15139, checked in by Mathieu Morlighem, 12 years ago

CHG: moved all coordinate system transformations to coordsystems, and added ll2mercator

File size: 433 bytes
Line 
1function [mx my]=ll2mercator(lat, lon),
2%LL2MERCATOR - transform lat long to mercator projection
3%
4% Usage:
5% [mx my]=ll2mercator(lat, lon)
6
7EARTH_RADIUS = 6378137;
8EQUATOR_CIRCUMFERENCE = 2 * pi * EARTH_RADIUS;
9INITIAL_RESOLUTION = EQUATOR_CIRCUMFERENCE / 256.0;
10ORIGIN_SHIFT = EQUATOR_CIRCUMFERENCE / 2.0;
11
12mx = (lon * ORIGIN_SHIFT) / 180.0;
13my = log(tan((90 + lat) * pi/360.0))/(pi/180.0);
14my = (my * ORIGIN_SHIFT) /180.0;
Note: See TracBrowser for help on using the repository browser.