You've got the problem transposed. We don't know the z coordinates, as we (like Plato) can only see the shadows (the projections on the XY plane). While we're currently seeking only the radius, it might also be nice to infer possible legal sets of zi's, as well. x1+x2+x3=0 (because the centroid is at the origin), but x1^2+y1^2+z1^2=R^2, but we don't know R or z1 (or z2 or z3). So we can't find the zi by simple linear algebra. So far, the simplest solution I've come up with is via the largest eigenvalue (or largest singular value) of the covariance matrix [see my later posting for this matrix]. But that's hardly high school stuff. It is cool, however, that PCA/SVD (Principal Component Analysis and Singular Value Decomposition) works so beautifully for such a small amount of data -- in this case, the bare minimum. I can see now why PCA/SVD has become the "goto" statistical method these days. At 05:24 PM 5/12/2014, Fred Lunnon wrote:
This ingeniously camouflaged problem had me bamboozled for a day or two, off and on --- more red herrings than a Soviet trawler!
And that's before I started on the suggested solutions: dunno how high-school kids would cope, 'cos I couldn't make head nor tail of either of 'em ...
So for the fainter-hearted amongst us, I propose the following rather more pedestrian approach.
Given some triangle P_1, P_2, P_3 in 3-space, with centroid at the origin, and vertex x, y-components; calculate circumradius R .
x_i + y_i + z_i = 0 yields z-components; (a_i)^2 = || P_(i+1) - P_(i+2) || yields square sides (a_i)^2 ; Heron formula yields squared area A^2 ; (a_1)^2 (a_2)^2 (a_3)^2 = 4 A^2 R^2 yields square radius R^2 ; and a single square root yields R .
While if also given that a_1 = a_2 = a_3 , then simply z_2 = -(x_2 + y_2) , z_3 = -(x_3 + y_3) , (a_1)^2 = (x_2 - x_3)^2 + (y_2 - y_3)^2 + (z_2 - z_3)^2 , R = sqrt( (3/4)(a_1)^2 ) by Pythagoras.
Mind you, as Knuth apparently remarked, I have only proved it --- I haven't tested it.
Fred Lunnon
Henry Baker (various dates) wrote <<
[High school kids could understand this, but probably not do it as an exercise.]
[Hints: least squares, Siebeck-Marden Theorem, max/abs hack.]
[Solution at bottom.]
We have an _equilateral_ triangle in arbitrary position in standard 3D space with coordinate axes x,y,z.
Translate this triangle (without rotations) so that its center becomes the origin.
The 3 vertices are P1=(x1,y1,z1), P2=(x2,y2,z2), P3=(x3,y3,z3).
We are given x1,y1,x2,y2 (but _not_ the z coordinates).
Obviously, x3=-x1-x2, y3=-y1-y2, due to the center being the origin.
Find a "simple" expression for the _radius_ of the circumcircle.
This problem is trivial in the case that x1^2+y1^2 = x2^2+y2^2 = x3^2+y3^2 = R^2, in which case z1=z2=z3=0, so we are interested in the more difficult case.
(Hint: you don't actually need the z coordinates.)
(Yes, I do have an answer, which is simpler than I had expected.) -------------------------------------------------- The hardest part of this problem is convincing yourself that it is even soluble. The 3 vertices are equally spaced around a ring which is rotated so that its projection onto the XY plane is an ellipse whose semimajor axis is the radius we seek. With only 3 points on the ring, it isn't a priori obvious that we have enough data to compute the parameters of the ellipse.
Nevertheless, the radius can be calculated with an elegant formula, thanks to a detour through the complex numbers.
Compute
real sumx2 = x1^2+x2^2+x3^2 real sumy2 = y1^2+y2^2+y3^2 complex sumz2 = (x1+iy1)^2+(x2+iy2)^2+(x3+iy3)^2
real 3*R^2 = sumx2 + sumy2 + |sumz2|
That's it!
[snip] >>