1
1

Bowring for short lines(精度良好な地理的距離の短距離近似法)

Last updated at Posted at 2024-07-16

こんにちは。
精度良好な地理的距離の短距離近似法として、Bowring's method for short lines (Wikipedia)1 を見つけました。

精度評価2を行うと、Gauss_mid_latitude(同じく短距離近似)よりも誤差は半球内では小さいです(下記のプロット)。

ソース

bowring_short.js
 // Bowring, B. R. (1981). "The direct and inverse problems for short geodesic lines on the ellipsoid". Surveying and Mapping. 41 (2): 135–141.
function bowring_short(lat1, lon1, lat2, lon2){  // in degrees
  "use strict";
  const a = 6378137.0;  // GRS80
  const f = 1 / 298.257223563;  // WGS84
  const e2 = f * (2 - f);  // first eccentricity squared
  const ep2 = e2 / (1 - f) ** 2;  // second eccentricity squared; epsilon

  const degree = Math.PI / 180.0;
  const sin = Math.sin;
  const cos = Math.cos;
  const sqrt = Math.sqrt;
  const hypot = Math.hypot;
  const asin2 = x => x < 1 ? 2 * Math.asin(x) : Math.PI;

  const londiffhalf = (lon2 - lon1) / 2 * degree;
  lat1 = lat1 * degree;
  lat2 = lat2 * degree;
  const latdiff = (lat2 - lat1);
  const cos_lat1 = cos(lat1);
  const cos_lat1_squared = cos_lat1 ** 2;

  const C = sqrt(1 + ep2);
  const B = sqrt(1 + ep2 * cos_lat1_squared);
  const A = sqrt(1 + ep2 * cos_lat1_squared ** 2);
  const R = C / B ** 2;

  const lonpdiffhalf = A * londiffhalf;  // longitude on the conformally mapped sphere
  const D = latdiff / B / 2 * (1 + (3 * ep2 / 4 / B ** 2) * latdiff * sin(2 * lat1 + 2 / 3 * latdiff));  // latpdiffhalf; latitude on the conformally mapped sphere
  const cos_latp = (B * cos_lat1 * cos(D) - sin(lat1) * sin(D)) / A;

  const E = cos(lonpdiffhalf) * sin(D);
  const F = sin(lonpdiffhalf) * cos_latp;
  return a * R *  asin2(hypot(E, F));  // geodesic distance
}

精度評価

bowring_short.jpg

  1. Bowring, B. R., "The direct and inverse problems for short geodesic lines on the ellipsoid". Surveying and Mapping (1981), p.135.

  2. 参考: 二点間測地線距離(地球上):各計算方法の誤差評価

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1