Skip to content
Advertisement

midpoint between two latitude and longitude

I am trying to convert the code snippet given in this http://www.movable-type.co.uk/scripts/latlong.html into java. But I am not getting same result as that of site. Here is my code to find the midpoint between two points where their latitudes and longitudes are given

JavaScript

I am not sure whethe dLon is correct or not. So please help me guys to figure it out. P.S.I need to find the latitude and longitude of the midpoint

Advertisement

Answer

You need to convert to radians. Change it to the following:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement