3

This question already has an answer here:

I am working on a research problem which requires me to calculate a geographic location accurately (with error distance of few meters), given distances from two geographic locations. For instance:

Problem

Since the points are static I know their location already. Flipping of the triangle is avoided by adding one more known location. I have calculated the distances using great circle distance formulae.

double theta = lon1 - lon2;
double dist = Math.sin(deg2rad(lat1)) * Math.sin(deg2rad(lat2)) 
            + Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) * Math.cos(deg2rad(theta));
dist = Math.acos(dist);
dist = rad2deg(dist);
dist = dist * 60 * 1.1515; // in miles

How to find the coordinates of C? The correct answer is 39.98, -83.03, but I am getting 8 miles off the track. Am I doing anything wrong?

marked as duplicate by whuber May 2 '14 at 19:00

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • A couple of points, do you know if the distances you are given are projected distance (if so, what coordinate system/projection) or accounting for the curved surface of the earth? Those two distances can be significantly different over distance. Also, if you are using a spherical earth, I don't know how you'd be able to determine which of the 2 possible C's it is. You could just as easily flip the triangle over along it's hypotenuse/long end and calculate a similar point...? Just some things to keep in mind. – John May 1 '14 at 17:38
  • Welcome to GIS.SE. You need to tell us what you have tried, using what software or formulae, and what coordinate system is being used (it looks like lat-long, w. decimal degrees). Please use the "edit" button, just above this note. – Martin F May 1 '14 at 17:41
  • 1
    Sorry, no time for more, but search for "trilateration". – mkennedy May 1 '14 at 21:45
  • Your error may be due to assumptions made in converting angular distance to miles. You should provide details on that magic number 1.1515. How did you get that, exactly? (I know it's seconds-to-miles, but it assumes a sphere of a certain radius.) Also, you still need to explain what your spatial reference system is exactly. – Martin F May 2 '14 at 18:26
  • @mkennedy provided a good tip: a search for trilateration produces many answers. Most, however, are not sufficiently accurate. Another nice set of solutions is found by reviewing relevant answers provided by user cffk, who is an expert on geodetic calculations and has provided accurate algorithms and links to appropriate software. – whuber May 2 '14 at 19:03