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:
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?