# How can I compute global triangulation from longitude/latitude coordinates?

I want to calculate an approximate location based on these inputs:

• 3 locations identified by latitude and longitude anywhere on a planet
• 3 angles, indicating the approximate direction from each of the 3 locations. For example, 0 degrees would be north, 90 degrees would be east, and so on.

The 3 angles will have some margin of error, so the 3 lines are unlikely to intersect exactly, and are likely to form a triangle, from which we can calculate some estimated area of interest. For example, we might calculate the center of the triangle, then draw a circle from that center that has the same areas as the triangle.

I would like to implement this in a computer program, where I can input the 3 locations, the 3 angles, and have it output a single location and radius.

You want to find the three intersection points of three pairs of great circles given a point and a bearing. Formulae for great circle intersections are given here:

http://www.movable-type.co.uk/scripts/latlong.html

There's a javascript widget there for testing, and code which you will have to convert to your unstated programming language of choice.

There's a python implementation here:

http://ssb.stsci.edu/doc/stsci_python_x/stsci.sphere.doc/html/_modules/stsci/sphere/great_circle_arc.html

but hopefully now you know what to look for (great circle intersection) you can find one in the programming language you want to use.

• This is perfect. It is covered in the moveable-type.co.uk link under the section "Intersection of two paths given start points and bearings". – user1594322 Aug 8 '16 at 19:43