找回密码
 快速注册
搜索
查看: 31|回复: 1

[几何] Mercator投影

[复制链接]

3149

主题

8386

回帖

6万

积分

$\style{scale:11;fill:#eff}꩜$

积分
65391
QQ

显示全部楼层

hbghlyj 发表于 2023-4-11 19:22 |阅读模式
Mercator projection transformations
Untitled.png
Consider a point on the globe of radius $R$ with longitude $λ$ and latitude $φ$. If $φ$ is increased by an infinitesimal amount, $dφ$, the point moves $R\,dφ$ along a meridian of the globe of radius $R$, so the corresponding change in $y$, $dy$, must be $hR\,dφ = R\sec φ\,dφ$. Therefore $y′(φ) = R\sec φ$. Similarly, increasing $λ$ by $dλ$ moves the point $R\cos φ\,dλ$ along a parallel of the globe, so $dx = kR\cos φ\,dλ = R\,dλ$. That is, $x'(λ) = R$. Integrating the equations$$ x'(\lambda )=R,\qquad y'(\varphi )=R\sec \varphi , $$with $x(λ_0) = 0$ and $y(0) = 0$, gives $x(λ)$ and $y(φ)$. The value $λ_0$ is the longitude of an arbitrary central meridian that is usually, but not always, that of Greenwich (i.e., zero). The angles $λ$ and $φ$ are expressed in radians. By the integral of the secant function,$$ x=R(\lambda -\lambda _{0}),\qquad y=R\ln \left[\tan \left({\frac {\pi }{4}}+{\frac {\varphi }{2}}\right)\right]. $$The function $y(φ)$ is plotted alongside $φ$ for the case $R = 1$: it tends to infinity at the poles. The linear $y$-axis values are not usually shown on printed maps; instead some maps show the non-linear scale of latitude values on the right. More often than not the maps show only a graticule of selected meridians and parallels.考虑地球上半径为 $R$、经度为 $λ$ 和纬度为 $φ$ 的点。如果 $φ$ 增加无穷小的量 $dφ$,则该点沿半径为 $R$ 的地球子午线移动 $R\,dφ$,因此 $y$、$dy$ 的相应变化必须是 $ hR\,dφ = R\sec φ\,dφ$。因此 $y′(φ) = R\sec φ$。类似地,将 $λ$ 增加 $dλ$ 会使点 $R\cos φ\,dλ$ 沿地球平行线移动,因此 $dx = kR\cos φ\,dλ = R\,dλ$。也就是说,$x'(λ) = R$。积分,$$ x'(\lambda )=R,\qquad y'(\varphi )=R\sec \varphi , $$$x(λ_0) = 0$ 和 $y(0) = 0$,给出 $x(λ)$ 和 $y(φ)$。值 $λ_0$ 是任意中央子午线的经度,通常但不总是格林威治的经度(即零)。角度 $λ$ 和 $φ$ 以弧度表示。通过正割函数的积分,$$ x=R(\lambda -\lambda _{0}),\qquad y=R\ln \left[\tan \left({\frac {\pi }{4} }+{\frac {\varphi }{2}}\right)\right]。$$函数 $y(φ)$ 与 $φ$ 一起绘制,用于 $R = 1$ 的情况:它在极点处趋于无穷大。线性 $y$ 轴值通常不会显示在印刷地图上; 相反,一些地图在右侧显示纬度值的非线性比例。通常情况下,地图只显示选定的经线和纬线的标线。

3149

主题

8386

回帖

6万

积分

$\style{scale:11;fill:#eff}꩜$

积分
65391
QQ

显示全部楼层

 楼主| hbghlyj 发表于 2023-4-11 19:31
js墨卡托与经纬度转换
  1. // 坐标转换
  2. var br = Math.PI / 180,
  3.     wr = 180 / Math.PI,
  4.     Er = 20037508.342789;
  5. function lngLatToMercator(t, e) {
  6.     var i = [t, e];
  7.     t instanceof Array
  8.         ? (i = t)
  9.         : t instanceof Object && (i = [t.lng, t.lat]);
  10.     var r = (i[0] * Er) / 180,
  11.         o = Math.log(Math.tan(((90 + i[1]) * br) / 2)) / br;
  12.     return { x: r, y: (o = (o * Er) / 180) };
  13. }
  14. function mercatorToLngLat(t, e) {
  15.     var i = [t, e];
  16.     t instanceof Array ? (i = t) : t instanceof Object && (i = [t.x, t.y]);
  17.     var r = (i[0] / Er) * 180,
  18.         o = (i[1] / Er) * 180;
  19.     return {
  20.         lng: r,
  21.         lat: (o = wr * (2 * Math.atan(Math.exp(o * br)) - Math.PI / 2))
  22.     };
  23. }
复制代码

手机版|悠闲数学娱乐论坛(第3版)

GMT+8, 2025-3-4 15:35

Powered by Discuz!

× 快速回复 返回顶部 返回列表