c# – Calculating the coordinates of the intersection point of several circles


In general, the condition is this: I parse one site from three geo-positions (with known locations), in response, json sends me from each such geo-position the distance to the object in kilometers / meters.

The actual problem: It is necessary to calculate the geographic coordinates of the target object, albeit with slight errors (for subsequent display on the map).

In short, there is a point (X; Y) and a radius.
For instance:
Measurement from 1st position (x1, y1) to object: 1.2 km
Measurement from 2nd position (x2, y2) to object: 3 km
Measurement from 3rd position (x3, y4) to object: 100 m
The object is the same, according to the intersection to be! (albeit with errors)

Help formulate a mathematical function (including the calculation of the error) or immediately an algorithm in C # 🙂


Your task is equivalent to what a GPS (GLONASS) receiver solves for satellite navigation.

You are given an unknown object coordinate (in your flat case x and y) and the distance Ri to objects (satellites) with known coordinates (xi, yi) (all with errors). The problem is solved by minimizing the criterion of the total squared error Min{ Sum[(Xi-X)^2+(Yi-Y)^2-Ri^2]^2 } . To obtain equations, you need to take from this criterion the partial derivatives with respect to x and y and equate them to zero.

As a result, you will receive a system of two cubic equations relative to two unknowns x and y.

How to solve such a system is already the next question 🙂

Scroll to Top