{
  "id": 6044,
  "title": "Spherical or flat?",
  "url": "/competitions/flight2-milestone/discussion/6044",
  "author_name": "",
  "post_date": "2013-10-17T14:59:25.827Z",
  "votes": null,
  "comment_count": 4,
  "views": 3108,
  "content": "<p>Hi,</p>\n<p>I was reading through the code and it seems to me that you get a penalty for computing proper spherical distances and path on great circles (unless you give a lot of waypoints).</p>\n<p>I say penalty because distance on the sphere is always &gt; distance on a flat patch. So if I would send my planes on a straight euclidean line instead of a GC and all distances are euclidean flat-grid then my fuel consumption would be lower (simply because the travelled distance is shorter, although this does not correspond to real life).</p>\n<p>Eg.: in flight.fs: stepToWaypoint (L76):</p>\n<p>&nbsp;let distanceRemaining = calculateDistance (currentX, currentY) (destinationX, destinationY)</p>\n<p>Then if you look at spatial.fs, let calculateDistance:</p>\n<p>all it does is flat grid distance (adding proper units), i.e.</p>\n<p>sqrt((destX-CurrX)^2+(destY-CurrY)^2)</p>\n<p>&nbsp;</p>\n<p>Is this right? Or is there something about easting Northing I did not understand (my code uses only latitude and longitude, so there was never a real need to get into details of easting and northing coordinate system).</p>",
  "messages": [
    {
      "id": "32388",
      "postDate": "10/17/2013 14:59:25",
      "content": "<p>Hi,</p>\n<p>I was reading through the code and it seems to me that you get a penalty for computing proper spherical distances and path on great circles (unless you give a lot of waypoints).</p>\n<p>I say penalty because distance on the sphere is always &gt; distance on a flat patch. So if I would send my planes on a straight euclidean line instead of a GC and all distances are euclidean flat-grid then my fuel consumption would be lower (simply because the travelled distance is shorter, although this does not correspond to real life).</p>\n<p>Eg.: in flight.fs: stepToWaypoint (L76):</p>\n<p>&nbsp;let distanceRemaining = calculateDistance (currentX, currentY) (destinationX, destinationY)</p>\n<p>Then if you look at spatial.fs, let calculateDistance:</p>\n<p>all it does is flat grid distance (adding proper units), i.e.</p>\n<p>sqrt((destX-CurrX)^2+(destY-CurrY)^2)</p>\n<p>&nbsp;</p>\n<p>Is this right? Or is there something about easting Northing I did not understand (my code uses only latitude and longitude, so there was never a real need to get into details of easting and northing coordinate system).</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "32391",
      "postDate": "10/17/2013 16:54:25",
      "content": "<p>See the bottom of <a href=\"http://www.gequest.com/c/flight2/forums/t/5529/simulator-issues-and-bug-reports/29819#post29819\">this post</a>&nbsp;which explains that:</p>\n<p>[quote]...any lats/longs inputted into the simulator immediately get converted onto a Lambert conformal conic projection [/quote]</p>\n<p>The wikipedia article on <a href=\"http://en.wikipedia.org/wiki/Lambert_conformal_conic_projection\">Lambert conformal conic projection</a> says that:</p>\n<p>[quote]Pilots favor these charts because a straight line drawn on a Lambert conformal conic projection approximates a great-circle route between endpoints [/quote]</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "32392",
      "postDate": "10/17/2013 18:14:36",
      "content": "<p>Thanks Christopher! But the questions remains how long the approximation remains true? I played a bit in the old leaderboard and if I remove some random points of the 2 flights I have which crash (due to exhausted fuel), the one which crashed at the second last wp lands decreasing my $perPlane-score by 30...</p>\n<p>And generally if I remove some random points from a random flight (paths are mainly but not always on the same GC) I actually also decrease my score (by some Cents only)--&gt;so it is only an approximation and it has an influence (although maybe only little).</p>\n<p>My grid points are separated 22km (spherical distance)...</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "32395",
      "postDate": "10/17/2013 20:42:47",
      "content": "<p>Yes, some of the differences you're seeing could be caused by the Lambert approximation. &nbsp;However, another confounding factor might be how you've set the waypoint altitudes. &nbsp;The simulator doesn't do a linear interpolation between waypoint altitudes...so deleting waypoints would change how long a plane cruises at &nbsp;higher, more fuel-efficient altitudes. &nbsp;That would change fuel consumption &amp; cost, too. &nbsp;.</p>\n<p>&nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "32412",
      "postDate": "10/18/2013 15:07:53",
      "content": "<p>Yes it does indeed, I wrote an optimization code which removes some of the 'less important' waypoints, getting my score down by 60$ (or from position 39 to 36, if I were to have submitted these routes during the competion) :-).</p>",
      "rawMarkdown": "",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 32391,
      "author_name": "chefele",
      "author_url": "",
      "post_date": "10/17/2013 16:54:25",
      "content": "<p>See the bottom of <a href=\"http://www.gequest.com/c/flight2/forums/t/5529/simulator-issues-and-bug-reports/29819#post29819\">this post</a>&nbsp;which explains that:</p>\n<p>[quote]...any lats/longs inputted into the simulator immediately get converted onto a Lambert conformal conic projection [/quote]</p>\n<p>The wikipedia article on <a href=\"http://en.wikipedia.org/wiki/Lambert_conformal_conic_projection\">Lambert conformal conic projection</a> says that:</p>\n<p>[quote]Pilots favor these charts because a straight line drawn on a Lambert conformal conic projection approximates a great-circle route between endpoints [/quote]</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 32392,
      "author_name": "sandros",
      "author_url": "",
      "post_date": "10/17/2013 18:14:36",
      "content": "<p>Thanks Christopher! But the questions remains how long the approximation remains true? I played a bit in the old leaderboard and if I remove some random points of the 2 flights I have which crash (due to exhausted fuel), the one which crashed at the second last wp lands decreasing my $perPlane-score by 30...</p>\n<p>And generally if I remove some random points from a random flight (paths are mainly but not always on the same GC) I actually also decrease my score (by some Cents only)--&gt;so it is only an approximation and it has an influence (although maybe only little).</p>\n<p>My grid points are separated 22km (spherical distance)...</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 32395,
      "author_name": "chefele",
      "author_url": "",
      "post_date": "10/17/2013 20:42:47",
      "content": "<p>Yes, some of the differences you're seeing could be caused by the Lambert approximation. &nbsp;However, another confounding factor might be how you've set the waypoint altitudes. &nbsp;The simulator doesn't do a linear interpolation between waypoint altitudes...so deleting waypoints would change how long a plane cruises at &nbsp;higher, more fuel-efficient altitudes. &nbsp;That would change fuel consumption &amp; cost, too. &nbsp;.</p>\n<p>&nbsp;</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 32412,
      "author_name": "sandros",
      "author_url": "",
      "post_date": "10/18/2013 15:07:53",
      "content": "<p>Yes it does indeed, I wrote an optimization code which removes some of the 'less important' waypoints, getting my score down by 60$ (or from position 39 to 36, if I were to have submitted these routes during the competion) :-).</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "32388": "",
    "32391": "",
    "32392": "",
    "32395": "",
    "32412": ""
  },
  "source": "meta"
}