Last post Oct 20, 2011 01:15 PM by iyju
May 01, 2008 01:10 PM|smartit07|LINK
Is it possible to calculate distance between two computer based on IP address?
Thanks in advance!
May 01, 2008 02:27 PM|karpach96|LINK
Yes it's possible. First you need to use some webservice to get latitude an longitude of ip address.
I am using this service for one of my projects.
And then use this formula to calculate distance:
x = [sin(lat1/57.2958) * sin(lat2/57.2958)] + [cos(lat1/57.2958) * cos(lat2/57.2958) * cos(lon2/57.2958 - lon1/57.2958)]
May 01, 2008 02:28 PM|PWick|LINK
http://www.seomoz.org/ip2loc <- Built in AJAX.
Good luck finding something that is open source for ASP.
May 05, 2008 03:14 AM|Vince Xu - MSFT|LINK
I'm agreed with karpach96 .
1. Convert IP address to Location via IP to Location Web Service. Such as using IP2Location.
2. Calculate the distance between two Latitude/Longitude points. You can check the below link.
3. If you want to get city name via Latitude/Longitude points. There is an available way to achieve it is to find a Web Service which can return to you the latitude according to city name.
This link is about that:
And the below one might be helpful for you:
Hope it helps
Jul 30, 2010 09:48 PM|SuperRom|LINK
I have used your formular however all I get back is are values such as .009485. No whole number. Is there something else that is needed for this formular to work correctly? Also, I have replaced the brackets with "(" since it I get an error with them installed.
Oct 20, 2011 01:15 PM|iyju|LINK
but how will you claculate the distance between two computers in a LAN using their ip address ?