Three Spheres and a Tetrahedron
문제
Given a tetrahedron with vertices , , and .
There is a sphere, (red, center ), inscribed in the tetrahedron tangent to the inside of each face (gray), (brown), (magenta) and (cyan and black).
There is a second sphere, (green, center ), tangent to the (extended) inside of , and and to the outside of . (There is actually such a sphere for each face, tangent to the outside of the face and the inside of the other extended faces).
There is a third larger sphere, (blue, center ), which passes thru vertices , and and is tangent to each of and so the outside of the smaller spheres is tangent to the inside of the largest sphere (see Figure 1, below, for two different views. Triangle is cyan in the first picture and black in the second one for clarity):
Figure 1
The following figures give several views of the tetrahedron and spheres.
Figure 2 shows the view along , which shows the two smaller spheres tangent to and (left). The view along shows the two smaller spheres tangent to and tangent on opposite sides of (right):
Figure 2
Figure 3 shows passing through , and and tangent to and . On the left, the view perpendicular to the plane of triangle , , shows passing through and . In the center, the view perpendicular to the plane of triangle , , shows passing through and . On the right, the view perpendicular to the plane of triangle , , (the centers of the three spheres) shows and tangent to the inside of .
Figure 3
Write a program which takes as input the vertices , , and and computes the center and radius of the big sphere (which entails finding the other two spheres).
will be the origin . A will lie on the positive -axis , will be on the −plane and will be in the first orthant . , and will be strictly positive and the remaining values will be non-negative.
입력
The input consists of a single line containing six double precision decimal values , , , , and in that order (as described above), (0 < Ax, By, Cz ≤ 10) and (0 ≤ Bx, Cx, Cy ≤ 10).
출력
The single line of output contains four decimal values to four decimal places: , , and of the big sphere.
예제
예제 1
2 3 2 3 1 4
2.8563 0.8218 1.8305 2.1816
예제 2
1 0 2 0 0 3
1.0000 1.2500 1.6667 2.0833