If I understand this correctly, I think this is one of the best ways.
So you'd use:
Assuming (x,y,z) correlates with the center points and x1, y2, x3... correlate with the other points..
sqrt((x1-x)^2 + (y1-y)^2 + (z1-z)^2) = A
sqrt((x2-x)^2 + (y2-y)^2 + (z2-z)^2) = B
sqrt((x3-x)^2 + (y3-y)^2 + (z3-z)^2) = C
Square both sides and expand so you get something like:
x1^2 - 2 * x1*x + x^2 + y1^2.... = A^2, keep doing that and get the other three.
Once you've expanded that out, you whould only be left with x, y, and z as your variables. Move all your constants to the other side of the equation where the length constants are so you should then three equations like so where c's represent the constants you will get:
c1*x^2 + c2 *x + c3 * y^2 + c4 * y.... = c
Now this part is tricky, if you know how to complete the square set it up in this form:
(x1 - x) ^2 + (y2 - y) ^2 .... = c for all the equations.
Manipulate those to wheere all the x1 - x for all three are identical, i.e. if one is (3 - x)^2 while in another equation its (2 - x)^2, add 1 to the (2 - x)^2 so it becomes (3 - x)^2 and then add a 1^2 to the other side to stay consistent.
Once all the forms are identical with only differing coefficients and differing constants that are outside the parenthesis. Set up a matrix of all the coefficients and outer constants. If A is a matrix of the coefficients of the parenthesis and C is a constant of the constants on the right side of the equation, then you can just do A ^ -1 * C to get a matrix of answers that are solutions to things inside the parenthesis. So if you get (x1 - x) ^2 = 12, just solve for the x1, and continue for the others. But I think that's how you do it.
"The only crime I'm guilty of is love [of china]"
- Ruthven
me clan me mod