I'm trying to reconstruct a set of points according to their relative distances and an initial known point a0. The points can be in any direction, as long as their relative distances are respected. The point a0 has the property of not being on the same plan that a1, a2 and a3.
Let dij be the distance between two points.
Considering a0 is placed at (x0, y0, z0), I have managed to place a1 at (x0+d10, y0, z0).
a0(x0, y0, z0)
a1(x0+d10, y0, z0)
In order to place a2, I consider two spheres S1 and S2 of centers d10 and d20 and of following equations. My idea is since the point I'm looking for is any of the points of the intersection of the spheres, I should be able to find a solution a2 among the solutions of the intersection.
d20² = (x2-x0)² + (y2-y0)² +(z2-z0)²
d21² = (x2-x1)² + (y2-y1)² +(z2-z1)²
I was expecting to obtain the equation of a cirle from these equations but all I can obtain is the following cartesian equation of a plan.
x2(x0-x1) + y2(y0-y1) + z2(z0-z1) + (d20-d21-x0²-x1²+y0²-y1²+z0²-z1²)/2 = 0
I wonder if I have made an algebric mistake though I checked twice, and if my assumption of obtaining the equation of a circle was wrong.
Also, even while assuming the equation I have obtained is correct, I'm unable to find a method to find a solution (x2, y2, z2) that fits the constraints. Any solution would be right but I can't deduce x2 from y2 and z2 since they have no constraints. I am writing an algorithm so I'm looking for an automatic solution.
I would be very grateful if you could help me, I have spend the entire day looking for a solution to that problem.