# Longtitude and Latitude

1. ## Longtitude and Latitude

I am currently working on this project and I need help. I have about 100 different variables with lats and long assigned to them. I used the equation below to find the distance from point a to point b, but now I am trying to come up with an additional equation that when I pick one of the variables, I can enter whatever miles I want and it will return all variables with lats and long within that circumference of the distance that I've entered. The equation I used for finding the miles is below:

2. ## Re: Longtitude and Latitude

This is accurate for small distances: http://williams.best.vwh.net/avform.htm#Dist

or a more accurate formula use: http://en.wikipedia.org/wiki/Vincenty%27s_formulae

3. ## Re: Longtitude and Latitude

Generally speaking you need not only a distance but a bearing.... So guessing you are trying to find Places within a distance of a know point.....

I use GIS....so I do not have any excel examples.

However suppose you want to find places within a distance d= 1000 km from M=(lat, long)=(1.3963, -0.6981). Lat long coordinates are in radians. A test to see whether or not a specifice LAT Long is within the distance from the point could be determined:

if this is true then the point is within the circle described by d away from M
acos(sin(1.3963) * sin(Lat_being_tested) + cos(1.3963) * cos(Lat_being_tested) * cos(Long_being_tested - (-0.6981))) * 6371 <= d

d = distance = in this example would be 1000

Hope this helps somewhat...

4. ## Re: Longtitude and Latitude

Thanks Ted for your response. But it seems that is trying to find the distance from point A to point B and not tell me what I am trying to solve.

5. ## Re: Longtitude and Latitude

Thanks again Ted from your prompt response. The new formula you just posted narrows it down for what I am trying to do, but I notice that you have Lat_being_tested and long_being_tested in the formula. What if I don't have Lat and Long being tested and all I want to do is to find places within 1000 miles radius from M(1.3963, -0.6981). But I have lats and longs for like 100 different variable and the mileage from one variables to the other. I am hoping I can find a formular that will tell me how many variables are within a certain one and will also return the mileage as well. Example of the answer will be:

Store A
Lat 2.3664 Long -74.6464

Store Z 10 miles away
Store T 17.3 Miles away
Store D 45.5 Miles away
etc

6. ## Re: Longtitude and Latitude

The Lat/Long Tested in you example would be the lat long of the stores Z,T & D the formula will calculate the distance between A and those stores. Then from that distance you can determine which ones you are interested in...

The M is simple your point of reference you want to base you distances from say from your example Store A

Note that you will need to convert the metric values in the formula I gave to english units if you are interested miles.

Maybe sending me a small sample of data you are working with along with your expected results would help me better understand what you are looking for.

There are currently 1 users browsing this thread. (0 members and 1 guests)