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