I have 4 points and need to find the distance between two of them

geometry

Assume you are given 4 points in an xy coordinate system. You know the distance between every set of points except two. You are not given the coordinates of the points. Is there a general formula for finding the last distance. My approach was to make one of the points from the set of points without specified distances a random point and to make the rest of the points as part of a triangle. With this, you can use the law of cosine and other triangles to derive the last side. However, you run into different scenarios and have to differentiate them by eye. I do not want to have to classify these scenarios.

Best Answer

Use the Cayley-Menger determinant for volume of a tetrahedron. With the four vertices in a plane, the volume is zero and this gives a quadratic equation in the square of a distance. Also the same thing in the Wikipedia article Quadrilateral on "other metric relations".