{"id":5339,"date":"2013-11-24T05:02:22","date_gmt":"2013-11-23T18:02:22","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=5339"},"modified":"2013-11-24T05:02:22","modified_gmt":"2013-11-23T18:02:22","slug":"phpjavascripthtml-great-circle-distance-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/phpjavascripthtml-great-circle-distance-tutorial\/","title":{"rendered":"PHP\/Javascript\/HTML Great Circle Distance Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Distance\/distance.php\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"PHP\/Javascript\/HTML Great Circle Distance Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Distance\/GreatCircleDistance.jpg\" title=\"PHP\/Javascript\/HTML Great Circle Distance Tutorial\" \/><\/a><p class=\"wp-caption-text\">PHP\/Javascript\/HTML Great Circle Distance Tutorial<\/p><\/div>\n<p>Here is a tutorial that calculates Great Circle Distances on Earth via the entry of Latitude and Longitude.  The calculations are not true geodesic calculations and so, we will show the result to the nearest metre.   We assume the radius of the Earth is 6371000 metres, but Land Surveyors will tell you this is a pretty simplistic assumption, for the reason that 6371000m could be improved upon, and because the Earth is not a true sphere, and, as is a real issue in the tutorial&#8217;s example, no account is taken of the Z co-ordinate, and methinks a walk down from the top of Mt Everest is worth a few metres, and a few beers, maybe?!  Of course, if you get into all this, it is a very interesting area, and <a target=_blank title='Great Circle Distance via Wikipedia' href='http:\/\/en.wikipedia.org\/wiki\/Great-circle_distance'>here<\/a> is a link to a Wikipedia page that may lead you to further research, if you want more detail.<\/p>\n<p>The Javascript embellishments in this tutorial mainly revolve around:<\/p>\n<ul>\n<li><a target=_blank title='window.open' href='http:\/\/www.w3schools.com\/jsref\/met_win_open.asp'>window.open<\/a><\/li>\n<\/ul>\n<p>The use of window.open can sometimes be blocked by web browsers depending on their settings and you can read a bit more about such issues <a target=_blank title='pop-up windows' href='http:\/\/en.wikipedia.org\/wiki\/Pop-up_ad'>here<\/a>.<\/p>\n<p>Useful tutorials that helped, and we give thanks to, were:<\/p>\n<ul>\n<li><a target=_blank title='Great Circle Distance formulae' href='http:\/\/en.wikipedia.org\/wiki\/Great-circle_distance'>Great Circle Distance formulae<\/a><\/li>\n<li><a target=_blank title='Javascript rounding' href='http:\/\/stackoverflow.com\/questions\/11832914\/round-up-to-2-decimal-places-in-javascript'>Javascript rounding<\/a><\/li>\n<li><a target=_blank title='Javascript commas for thousands' href='http:\/\/www.mredkj.com\/javascript\/nfbasic.html'>Javascript commas for thousands<\/a><\/li>\n<li><a target=_blank title='Katmandu positioning via a Google search' href='https:\/\/www.google.com.au\/search?q=%22katmandu%22&#038;ie=utf-8&#038;oe=utf-8&#038;rls=org.mozilla:en-US:official&#038;client=firefox-a&#038;gfe_rd=ctrl&#038;ei=hk-QUriHM8qN8QeQzIDoDQ&#038;gws_rd=cr#q=%22katmandu+latitude%22&#038;rls=org.mozilla:en-US%3Aofficial '>Katmandu positioning via a Google search<\/a><\/li>\n<\/ul>\n<p>Here is a link to a <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Distance\/distance.php\" title='Live run'>live run<\/a>.  (The way it changed on 1\/12\/2013 to have a dropdown of placenames as extra functionality will be explained in a tutorial called PHP\/Javascript\/HTML Geographical Placename Integration Tutorial on 3\/12\/2013.)<\/p>\n<p>Here is a link to some downloadable PHP programming source code which you may want to rename to <a target=_blank title='distance.php' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Distance\/distance.php_GETME\">distance.php<\/a><\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d5339' onclick='var dv=document.getElementById(\"d5339\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?cat=59\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d5339' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Here is a tutorial that calculates Great Circle Distances on Earth via the entry of Latitude and Longitude. The calculations are not true geodesic calculations and so, we will show the result to the nearest metre. We assume the radius &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/phpjavascripthtml-great-circle-distance-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,21,36,37],"tags":[527,542,576,652,679,932,997,1311,1319],"class_list":["post-5339","post","type-post","status-publish","format-standard","hentry","category-elearning","category-land-surveying","category-trips","category-tutorials","tag-google-maps","tag-great-circle-distance","tag-html","tag-javascript","tag-land-surveying","tag-php","tag-programming","tag-trip","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/5339"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=5339"}],"version-history":[{"count":0,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/5339\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=5339"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=5339"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=5339"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}