<p>Google's "Web Mercator" projection  is a very different beast from the Mercator projection. The former provides a coordinate system for the area you are viewing, oriented in the way you rotated the view.  </p>

<p>The formulas you put in your original question are probably more computationally efficient when used for this purpose, but they do <strong>not</strong> foster understanding. </p>

<p>In fact, those formulas are obfuscatory, since they include an <a href="https://en.wikipedia.org/wiki/Eccentricity_(mathematics)" rel="nofollow noreferrer">eccentricity</a> term <span class="math-container">$e$</span> (this is <strong>not</strong> the base of the natural logarithms), but Google uses a spherical model where <span class="math-container">$e=0$</span>. </p>

<p>The letter <span class="math-container">$a$</span> (the one without the subscript) is typically used for an ellipsoid's <a href="https://en.wikipedia.org/wiki/Semi-major_and_semi-minor_axes" rel="nofollow noreferrer">semimajor axis</a> (for Earth this is about 6378 km depending on the geodetic model used). When <a href="https://en.wikipedia.org/wiki/Spherical_cow" rel="nofollow noreferrer">assuming a spherical Earth</a>, use <span class="math-container">$R$</span> instead, to refer to Earth's "radius".</p>

<p><span class="math-container">$a_{map}$</span>, on the other hand, is the map scale, the desired ratio between distances between points on the ground and their corresponding points on the map. </p>

<p>Notice that the equations you provide give <a href="https://en.wikipedia.org/wiki/Derivative" rel="nofollow noreferrer">derivatives</a>, that is, the rate of change of one parameter based on another. They give <span class="math-container">$dx/dE$</span> and  <span class="math-container">$dy/dN$</span> instead of <span class="math-container">$x$</span> and <span class="math-container">$y$</span>. E and N are the coordinates derived by rotating and aligning the Earth to your view. Because Google assumes a sphere, you can get them by running the latitude and longitude through  an <a href="https://en.wikipedia.org/wiki/Azimuthal_equidistant_projection" rel="nofollow noreferrer">azimuthal equidistant</a> projection with the given center and rotation.</p>

<p>The Mercator projection is a <a href="http://www.geography.hunter.cuny.edu/~jochen/GTECH361/lectures/lecture04/concepts/Map%20coordinate%20systems/Cylindrical%20projections.htm" rel="nofollow noreferrer">cylindrical</a> one, that is, the coordinate system is developed by wrapping a cylinder around the Earth, projecting its features onto the cylinder, and then unrolling the cylinder to lie flat. </p>

<p>This causes the lines of latitude and longitude to form a rectangular grid. In such a projection, the ratio between the final x coordinate and the longitude is a constant. This constant is <span class="math-container">$a*a_{map}$</span> using the notation from the original question. Thus, changes in scale do not depend on the longitude, so longitude does not appear in the formulas.</p>

<p>It's also a <a href="https://en.wikipedia.org/wiki/Conformal_map_projection" rel="nofollow noreferrer">conformal</a>  projection, meaning that the distance distortion values for the two dimensions are the same. </p>

<p>More intuitive formulas calculate x and Y directly. For the spherical case, in the equatorial aspect:</p>

<p><span class="math-container">$$x=R*a_{map}*(\lambda-\lambda_0)$$</span></p>

<p><span class="math-container">$$y=R*a_{map}*ln \left[ tan \left(\frac{\pi}{4} +\frac{\phi}{2}\right)\right]$$</span></p>

<p>The ellipsoidal formula is more complicated: </p>

<p><span class="math-container">$$y=a*a_{map}* ln \left[ tan \left(\frac{\pi}{4} +\frac{\phi}{2}\right) * \left(\frac{1-e* sin\phi}{1+e*sin \phi}\right)^\frac{e}{2} \right]$$</span></p>

<p>(It's one of the <em>simplest</em> ellipsoidal projection formulas, however!)</p>

<p>These formulas appear in <a href="https://en.wikipedia.org/wiki/Mercator_projection" rel="nofollow noreferrer">the Wikipedia article on the Mercator projection</a> and are the ones you should pay attention to. </p>

CC BY-SA 4.0
2019-10-27T16:13:06.453Z
2020-05-12T18:36:13.233Z
2020-05-12T18:36:13.233Z
Spencer
<p>The Mercator Projection has been used and it is used since the XVI century due to it maintain the course, rhumb or route. So it is useful for navigation.</p>

<p>As the Earth is approached by a ellipsoid, then you get the formulas that you saw on <a href="https://en.wikipedia.org/wiki/Mercator_projection" rel="nofollow noreferrer">Mercator Projection.</a> This transformation it is complicated for a ellipsoid, as the Earth curvature it is not a constant, so in the example you gave (moving 300m eastwords, or 400m northwards), you need to transform the first point from geographical coordinates to rectangular coordinates, then shift the point 300 meters east, check the correction on distance due to the different curvature on each point, apply the correction, then shift the point 400 meters northwards, check the correction, apply the correction and bring the coordinates back to geographical coordinate.</p>

<p>That is to much computing time and there are a lost of precision loss on the different shiftings and transformation geographical &lt;-> rectangular coordinates. <a href="https://en.wikipedia.org/wiki/Web_Mercator_projection" rel="nofollow noreferrer">Web Mercator</a> is just a Mercator that considers the Earth approach by an sphere, not a ellipsoid. That is much easier, needs less computation as, the curvature in a sphere is constant it is not required to consider. </p>

<p>Mercator projection is ok for navigation (that is what you are doing with Google Earth or Google Maps). Check this <a href="https://gis.stackexchange.com/questions/48949/epsg-3857-or-4326-for-googlemaps-openstreetmap-and-leaflet">link.</a></p>

<p>Regarding the constants... <code>a</code> is the semi-major axis of an ellipsoid, <code>amap</code> is the semi-major axis on the map (as the Mercator Projection is distorting the distances, you should make a distance correction, that it is become bigger as far as you are from the Equator) <code>e</code> is the eccentricity of the ellipsoid. </p>

<p>Regarding the latitude issue... Thing a little bit on this question: In the Mercator Projection it is consider, as Earth approach a sphere and a revolution ellipsoid. Both surfaces are revolution surfaces so, there is no variation along the longitude way. That is why the longitude is not required for Y calculation.</p>

<p>Anyhow, is something is not clear, just let me know. Hope it helps!</p>

CC BY-SA 4.0
2019-10-26T13:02:34.717Z
2019-10-26T13:02:34.717Z
David García Bodego
<p>The theory or purpose behind the Web Mercator projection is to project the globe into a rectangle made up of equally sized tiles at any zoom level. It's accuracy is highly suspect for calculating area's and distance; it is used because it makes it fast and easy to cache tiles to serve imagery and other basemaps. Rather than use the formula on Wikipedia i would look up EPSG:3857 (Mercator). As for using Google maps, it lets you toggle the reference system in the viewer from decimal to lat/long.</p>

CC BY-SA 3.0
2014-11-05T15:07:33.013Z
"it is horribly inaccurate for modeling or processing data". This statement is false. Mercator projection is commonly used in ocean and atmosphere modeling, curvilinear grids facilitating high accuracy on arbitrary projections.
milancurcic
CC BY-SA 3.0
2014-11-05T15:20:23.993Z
I'll caveat by saying its horribly inaccurate at modeling or geoprocessing for use in landscape or watershed and/or terrestrial land planning as is distorts the relationship between distance between features.. I'm talking specifically about the web Mercator projection used by Google and other basemap services. That said I stand by the statement
user33290
CC BY-SA 3.0
2014-11-06T14:48:38.663Z
Heh, it seems I wasn't sure what I was looking for now. Done a bit more research now, and in conjunction with the answer above I realize that use of the Mercator projection is completely unnecessary (even if it is fascinating stuff).
Thankoo! <3
bmus
CC BY-SA 3.0
2014-12-18T23:17:40.997Z
In EPSG:3857 aka "Web Mercator", the world is a square, not a rectangle, because it's cut off at approximately +/-85.05 degrees.
mkennedy
CC BY-SA 3.0
2014-12-19T10:45:09.713Z
@milancurcic I think the point that user33290 is making is that Google Maps does not use Mercator projection. It uses a simplified version called "Web Mercator", which saves on processing time.
Semidiurnal Simon
CC BY-SA 4.0
2014-11-05T13:33:06.560Z
2018-07-24T13:06:49.243Z
2018-07-24T13:06:49.243Z
user33290
<p>To illustrate my problem, let's say I have lattitude and longitude coordinates, such as 38.871105, -77.056042.
I want to be able to calculate the new lattitude and longitude if, say, I moved 300m eastwords, or 400m northwards, in a way that google maps will like.
Now, from what I can understand, this would mean converting it from lat/long to mercator pixel coordinates, getting new mercator pixel coordinates then converting back to lat/long...</p>

<p>Here's what Wikipedia has to say on Google's Mercator projection:</p>

<p><img src="https://i.sstatic.net/v2EVw.png" alt="Wikipedia&#39;s formula">
Why do the above equations not actually take into account the longitude? And what is a? If I could understand these equations then theoretically the rest should be easy...
Thanks!
-B</p>

CC BY-SA 3.0
2014-11-05T14:07:19.127Z
Your problem is not projection dependent. The map projection relates spherical coordinate system to some other (this may be pixel coordinates, physical space etc.). Since Google Maps API will handle lat/lon input, you just need to calculate your travel distance. Distance (in meters) northward is linearly proportional to distance in degrees latitude. Distance (in meters) eastward will depend on a cosine of latitude besides being linearly proportional to distance in longitude. Also, look into great circle distances and Haversine formula and others for higher accuracy calculations.
milancurcic
CC BY-SA 3.0
2014-11-06T16:06:39.077Z
I think it would be good if you post what you found as the answer.
milancurcic
CC BY-SA 3.0
2014-12-18T23:22:14.617Z
a = semimajor axis of the ellipsoid or sphere used for the model of the Earth.
mkennedy
<models><cartography>
Understanding the Mercator Projection
bmus
# Understanding the Mercator Projection

(Asked by: username_0 on 2014-11-05)

To illustrate my problem, let's say I have lattitude and longitude coordinates, such as 38.871105, -77.056042.
I want to be able to calculate the new lattitude and longitude if, say, I moved 300m eastwords, or 400m northwards, in a way that google maps will like.
Now, from what I can understand, this would mean converting it from lat/long to mercator pixel coordinates, getting new mercator pixel coordinates then converting back to lat/long...

Here's what Wikipedia has to say on Google's Mercator projection:

![Wikipedia's formula](https://i.sstatic.net/v2EVw.png)
Why do the above equations not actually take into account the longitude? And what is a? If I could understand these equations then theoretically the rest should be easy...
Thanks!
-B

**Tags:** models, cartography

> **Comments:**
> **username_1**: Your problem is not projection dependent. The map projection relates spherical coordinate system to some other (this may be pixel coordinates, physical space etc.). Since Google Maps API will handle lat/lon input, you just need to calculate your travel distance. Distance (in meters) northward is linearly proportional to distance in degrees latitude. Distance (in meters) eastward will depend on a cosine of latitude besides being linearly proportional to distance in longitude. Also, look into great circle distances and Haversine formula and others for higher accuracy calculations.  
> **username_1**: I think it would be good if you post what you found as the answer.  
> **username_2**: a = semimajor axis of the ellipsoid or sphere used for the model of the Earth.  

---

## 3 answers

### Answer by username_3 on 2019-10-27. Score: 1

Google's "Web Mercator" projection is a very different beast from the Mercator projection. The former provides a coordinate system for the area you are viewing, oriented in the way you rotated the view.

The formulas you put in your original question are probably more computationally efficient when used for this purpose, but they do **not** foster understanding.

In fact, those formulas are obfuscatory, since they include an [eccentricity](https://en.wikipedia.org/wiki/Eccentricity_(mathematics)) term $e$ (this is **not** the base of the natural logarithms), but Google uses a spherical model where $e=0$.

The letter $a$ (the one without the subscript) is typically used for an ellipsoid's [semimajor axis](https://en.wikipedia.org/wiki/Semi-major_and_semi-minor_axes) (for Earth this is about 6378 km depending on the geodetic model used). When [assuming a spherical Earth](https://en.wikipedia.org/wiki/Spherical_cow), use $R$ instead, to refer to Earth's "radius".

$a\_{map}$, on the other hand, is the map scale, the desired ratio between distances between points on the ground and their corresponding points on the map.

Notice that the equations you provide give [derivatives](https://en.wikipedia.org/wiki/Derivative), that is, the rate of change of one parameter based on another. They give $dx/dE$ and $dy/dN$ instead of $x$ and $y$. E and N are the coordinates derived by rotating and aligning the Earth to your view. Because Google assumes a sphere, you can get them by running the latitude and longitude through an [azimuthal equidistant](https://en.wikipedia.org/wiki/Azimuthal_equidistant_projection) projection with the given center and rotation.

The Mercator projection is a [cylindrical](http://www.geography.hunter.cuny.edu/~jochen/GTECH361/lectures/lecture04/concepts/Map%20coordinate%20systems/Cylindrical%20projections.htm) one, that is, the coordinate system is developed by wrapping a cylinder around the Earth, projecting its features onto the cylinder, and then unrolling the cylinder to lie flat.

This causes the lines of latitude and longitude to form a rectangular grid. In such a projection, the ratio between the final x coordinate and the longitude is a constant. This constant is $a\*a\_{map}$ using the notation from the original question. Thus, changes in scale do not depend on the longitude, so longitude does not appear in the formulas.

It's also a [conformal](https://en.wikipedia.org/wiki/Conformal_map_projection) projection, meaning that the distance distortion values for the two dimensions are the same.

More intuitive formulas calculate x and Y directly. For the spherical case, in the equatorial aspect:

$$x=R\*a\_{map}\*(\lambda-\lambda\_0)$$

$$y=R\*a\_{map}\*ln \left[ tan \left(\frac{\pi}{4} +\frac{\phi}{2}\right)\right]$$

The ellipsoidal formula is more complicated:

$$y=a\*a\_{map}\* ln \left[ tan \left(\frac{\pi}{4} +\frac{\phi}{2}\right) \* \left(\frac{1-e\* sin\phi}{1+e\*sin \phi}\right)^\frac{e}{2} \right]$$

(It's one of the *simplest* ellipsoidal projection formulas, however!)

These formulas appear in [the Wikipedia article on the Mercator projection](https://en.wikipedia.org/wiki/Mercator_projection) and are the ones you should pay attention to.


---

### Answer by username_4 on 2019-10-26. Score: 1

The Mercator Projection has been used and it is used since the XVI century due to it maintain the course, rhumb or route. So it is useful for navigation.

As the Earth is approached by a ellipsoid, then you get the formulas that you saw on [Mercator Projection.](https://en.wikipedia.org/wiki/Mercator_projection) This transformation it is complicated for a ellipsoid, as the Earth curvature it is not a constant, so in the example you gave (moving 300m eastwords, or 400m northwards), you need to transform the first point from geographical coordinates to rectangular coordinates, then shift the point 300 meters east, check the correction on distance due to the different curvature on each point, apply the correction, then shift the point 400 meters northwards, check the correction, apply the correction and bring the coordinates back to geographical coordinate.

That is to much computing time and there are a lost of precision loss on the different shiftings and transformation geographical <-> rectangular coordinates. [Web Mercator](https://en.wikipedia.org/wiki/Web_Mercator_projection) is just a Mercator that considers the Earth approach by an sphere, not a ellipsoid. That is much easier, needs less computation as, the curvature in a sphere is constant it is not required to consider.

Mercator projection is ok for navigation (that is what you are doing with Google Earth or Google Maps). Check this [link.](https://gis.stackexchange.com/questions/48949/epsg-3857-or-4326-for-googlemaps-openstreetmap-and-leaflet)

Regarding the constants... `a` is the semi-major axis of an ellipsoid, `amap` is the semi-major axis on the map (as the Mercator Projection is distorting the distances, you should make a distance correction, that it is become bigger as far as you are from the Equator) `e` is the eccentricity of the ellipsoid.

Regarding the latitude issue... Thing a little bit on this question: In the Mercator Projection it is consider, as Earth approach a sphere and a revolution ellipsoid. Both surfaces are revolution surfaces so, there is no variation along the longitude way. That is why the longitude is not required for Y calculation.

Anyhow, is something is not clear, just let me know. Hope it helps!


---

### Answer by username_5 on 2014-11-05. Score: -1

The theory or purpose behind the Web Mercator projection is to project the globe into a rectangle made up of equally sized tiles at any zoom level. It's accuracy is highly suspect for calculating area's and distance; it is used because it makes it fast and easy to cache tiles to serve imagery and other basemaps. Rather than use the formula on Wikipedia i would look up EPSG:3857 (Mercator). As for using Google maps, it lets you toggle the reference system in the viewer from decimal to lat/long.

> **Comments:**
> **username_1**: "it is horribly inaccurate for modeling or processing data". This statement is false. Mercator projection is commonly used in ocean and atmosphere modeling, curvilinear grids facilitating high accuracy on arbitrary projections.  
> **username_5**: I'll caveat by saying its horribly inaccurate at modeling or geoprocessing for use in landscape or watershed and/or terrestrial land planning as is distorts the relationship between distance between features.. I'm talking specifically about the web Mercator projection used by Google and other basemap services. That said I stand by the statement  
> **username_0**: Heh, it seems I wasn't sure what I was looking for now. Done a bit more research now, and in conjunction with the answer above I realize that use of the Mercator projection is completely unnecessary (even if it is fascinating stuff). Thankoo! <3  
> **username_2**: In EPSG:3857 aka "Web Mercator", the world is a square, not a rectangle, because it's cut off at approximately +/-85.05 degrees.  
> **username_6**: @username_1 I think the point that username_5 is making is that Google Maps does not use Mercator projection. It uses a simplified version called "Web Mercator", which saves on processing time.  

---

