Skip to main content
1 of 4

Trilateration using 3 x,y points and 3 distances, all in cm

I want to find out the position (x,y) of a given point, knowing the distance from 3 x,y points.

Below you can view the x,y coordinates and their given distances in cm.

B1x = 795
B1y = 332
B1d = 245.735630302

B2x = 795
B2y = 569
B2d = 327.946642001

B3x = 516
B3y = 569
B3d = 220.635445928

I have had a look at this question, but this is for earth, and I get the error:

z = math.sqrt(pow(DistA,2) - pow(x,2) - pow(y,2)) ValueError: math domain error

I want my algorithm to calculate in a 2D environment, with the given values above.

Here is the map:

You can see the green X, is where I want to locate, from the three given beacons (x,y) locations.

enter image description here