Link to home
Start Free TrialLog in
Avatar of burnedfaceless
burnedfaceless

asked on

Determining Latitude and Longitude

I have a small project I am doing.

I am given the distance I am from an item. The distance goes as small as < 1 mile.

I would like to determine the latitude and longitude of this item. I give coordinates and it gives me a distance in miles.

How would I go about this?
Avatar of CompProbSolv
CompProbSolv
Flag of United States of America image

You need more information.  There is a full circle of points that are a specific distance away from you.  You need something, such as the angle from north to the destination, to get the specific location.
First we need the coordinates of the start location, the direction of travel and the distance. with this information we can compute the x and y values
Avatar of phoffric
phoffric

Not sure what the input and outputs of your desired function are. It would help if you would write down a function showing the input args (and their units), and the return value (and their units, and range).

Here are two interpretations of your question:
>> I am given the distance I am from an item.
Input:
   -- startingPoint (lat/lon)
   -- distance (units?)
   -- angle (degrees, -180..+179.999), where -180 --> heading south, and 0 --> heading north
Output:
   -- endingPoint (lat/lon)

Open in new window


>> I give coordinates and it gives me a distance in miles.
Input:
   -- startingPoint (lat/lon)
   -- endingPoint (lat/lon)
Output:
   -- distance (units?)

Open in new window

Don't see why you would need direction as part of the input
This is simply the difference between two discreet points. Not about navigation.
Then assume Earth is a sphere of known radius in Miles and off you go.
https://blog.batchgeo.com/manipulating-coordinates-in-excel/
Enter your location for your coordinates
Enter the other location for the corodinates of that place.

https://www.latlong.net/

From the above tool you get the coordinates of both places (you and the one under a miles from you).
You already know the distance?
--------------------------------------

How do you calculate distance using latitude and longitude?

For this divide the values of longitude and latitude of both the points by 180/pi. The value of pi is 22/7. The value of 180/pi is approximately 57.29577951. If we want to calculate the distance between two places in miles, use the value 3, 963, which is the radius of Earth.

So that gives you a formula for calculating distance using coordinates

https://www.geeksforgeeks.org/program-distance-two-points-earth/

Example:

Input : Latitude 1: 53.32055555555556
        Latitude 2: 53.31861111111111
        Longitude 1: -1.7297222222222221
        Longitude 2: -1.6997222222222223

Output: Distance is: 2.0043678382716137 Kilometers
Avatar of burnedfaceless

ASKER

The function would be like this

Input:
  -- Starting point (Latitude longitude)
  -- Distance to end point


Output
  -- End point (Latitude longitude)

Open in new window

I can plug in latitude and longitude repeatedly to get the endpoint closer. The lowest distance of the endpoint is < 1 mile.
ASKER CERTIFIED SOLUTION
Avatar of phoffric
phoffric

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial