{
  "id": 238800,
  "title": "Vincenty’s formula: Distances on Earth with extreme accuracy",
  "url": "/competitions/google-smartphone-decimeter-challenge/discussion/238800",
  "author_name": "Carl McBride Ellis",
  "post_date": "2021-05-13T13:23:01.852000",
  "votes": 33,
  "comment_count": 0,
  "views": 0,
  "content": "<p>In this competition precision is paramount. There is the <a href=\"https://en.wikipedia.org/wiki/Haversine_formula\" target=\"_blank\">haversine formula</a> for calculating the distance between two points given their longitudes and latitudes, but this assumes that the Earth is a sphere. However, Vincenty produced formulas assuming that the Earth is an oblate spheroid, and is accurate to within 1mm.</p>\n<p>Given that we seem to be using the <a href=\"https://www.mathworks.com/help/map/ref/wgs84ellipsoid.html\" target=\"_blank\">Reference ellipsoid for World Geodetic System of 1984</a> it may be worth using the Vincenty formula rather than the haversine formula.</p>\n<p>These formula are <em>very</em> complicated, but thankfully there is a GitHub package <a href=\"https://github.com/maurycyp/vincenty\" target=\"_blank\">\"Vincenty\"</a> to make things easy:</p>\n<blockquote>\n  <p><code>!pip install vincenty</code></p>\n</blockquote>\n<p>for example:</p>\n<blockquote>\n  <p><code>from vincenty import vincenty</code><br>\n  <code>boston = (42.3541165, -71.0693514)</code><br>\n  <code>newyork = (40.7791472, -73.9680804)</code><br>\n  <code>vincenty(boston, newyork)</code></p>\n  <p>298.396057</p>\n</blockquote>\n<p>All the best, and good luck!</p>",
  "messages": [
    {
      "id": 1305775,
      "postDate": "2021-05-13T13:23:01.853Z",
      "content": "<p>In this competition precision is paramount. There is the <a href=\"https://en.wikipedia.org/wiki/Haversine_formula\" target=\"_blank\">haversine formula</a> for calculating the distance between two points given their longitudes and latitudes, but this assumes that the Earth is a sphere. However, Vincenty produced formulas assuming that the Earth is an oblate spheroid, and is accurate to within 1mm.</p>\n<p>Given that we seem to be using the <a href=\"https://www.mathworks.com/help/map/ref/wgs84ellipsoid.html\" target=\"_blank\">Reference ellipsoid for World Geodetic System of 1984</a> it may be worth using the Vincenty formula rather than the haversine formula.</p>\n<p>These formula are <em>very</em> complicated, but thankfully there is a GitHub package <a href=\"https://github.com/maurycyp/vincenty\" target=\"_blank\">\"Vincenty\"</a> to make things easy:</p>\n<blockquote>\n  <p><code>!pip install vincenty</code></p>\n</blockquote>\n<p>for example:</p>\n<blockquote>\n  <p><code>from vincenty import vincenty</code><br>\n  <code>boston = (42.3541165, -71.0693514)</code><br>\n  <code>newyork = (40.7791472, -73.9680804)</code><br>\n  <code>vincenty(boston, newyork)</code></p>\n  <p>298.396057</p>\n</blockquote>\n<p>All the best, and good luck!</p>",
      "rawMarkdown": "In this competition precision is paramount. There is the [haversine formula](https://en.wikipedia.org/wiki/Haversine_formula) for calculating the distance between two points given their longitudes and latitudes, but this assumes that the Earth is a sphere. However, Vincenty produced formulas assuming that the Earth is an oblate spheroid, and is accurate to within 1mm.\n\nGiven that we seem to be using the [Reference ellipsoid for World Geodetic System of 1984](https://www.mathworks.com/help/map/ref/wgs84ellipsoid.html) it may be worth using the Vincenty formula rather than the haversine formula.\n\nThese formula are *very* complicated, but thankfully there is a GitHub package [\"Vincenty\"](https://github.com/maurycyp/vincenty) to make things easy:\n\n> `!pip install vincenty`\n\nfor example:\n\n> `from vincenty import vincenty`\n> `boston = (42.3541165, -71.0693514)`\n> `newyork = (40.7791472, -73.9680804)`\n> `vincenty(boston, newyork)`\n\n> 298.396057\n\nAll the best, and good luck!",
      "votes": 33
    }
  ],
  "comments": [],
  "raw_markdown_by_id": {
    "1305775": "In this competition precision is paramount. There is the [haversine formula](https://en.wikipedia.org/wiki/Haversine_formula) for calculating the distance between two points given their longitudes and latitudes, but this assumes that the Earth is a sphere. However, Vincenty produced formulas assuming that the Earth is an oblate spheroid, and is accurate to within 1mm.\n\nGiven that we seem to be using the [Reference ellipsoid for World Geodetic System of 1984](https://www.mathworks.com/help/map/ref/wgs84ellipsoid.html) it may be worth using the Vincenty formula rather than the haversine formula.\n\nThese formula are *very* complicated, but thankfully there is a GitHub package [\"Vincenty\"](https://github.com/maurycyp/vincenty) to make things easy:\n\n> `!pip install vincenty`\n\nfor example:\n\n> `from vincenty import vincenty`\n> `boston = (42.3541165, -71.0693514)`\n> `newyork = (40.7791472, -73.9680804)`\n> `vincenty(boston, newyork)`\n\n> 298.396057\n\nAll the best, and good luck!"
  }
}