PivotOJ

Three Spheres and a Tetrahedron

시간 제한: 1000ms메모리 제한: 1024MB출처: ICPC Greater New York 2021BOJ 24744

문제

Given a tetrahedron OABCOABC with vertices OO, AA, BB and CC.

There is a sphere, S1S1 (red, center Q1Q1), inscribed in the tetrahedron tangent to the inside of each face OABOAB (gray), OACOAC (brown), OBCOBC (magenta) and ABCABC (cyan and black).

There is a second sphere, S2S2 (green, center Q2Q2), tangent to the (extended) inside of OABOAB, OACOAC and OBCOBC and to the outside of ABCABC. (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, S3S3 (blue, center Q3Q3), which passes thru vertices AA, BB and CC and is tangent to each of S1S1 and S2S2 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 ABCABC 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 OAOA, which shows the two smaller spheres tangent to OABOAB and OACOAC (left). The view along BCBC shows the two smaller spheres tangent to OBCOBC and tangent on opposite sides of ABCABC (right):

Figure 2

Figure 3 shows S3S3 passing through AA, BB and CC and tangent to S1S1 and S2S2. On the left, the view perpendicular to the plane of triangle AA, BB, Q3Q3 shows S3S3 passing through AA and BB. In the center, the view perpendicular to the plane of triangle AA, CC, Q3Q3 shows S3S3 passing through AA and CC. On the right, the view perpendicular to the plane of triangle Q1Q1, Q2Q2, Q3Q3 (the centers of the three spheres) shows S1S1 and S2S2 tangent to the inside of S3S3.

Figure 3

Write a program which takes as input the vertices OO, AA, BB and CC and computes the center and radius of the big sphere (which entails finding the other two spheres).

OO will be the origin (0,0,0)(0,0,0). A will lie on the positive xx-axis (Ax,0,0)(Ax,0,0), BB will be on the xyxy−plane (Bx,By,0)(Bx,By,0) and CC will be in the first orthant (Cx,Cy,Cz)(Cx,Cy,Cz). AxAx, ByBy and CzCz 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 AxAx, BxBx, ByBy, CxCx, CyCy and CzCz in that order (as described above), (0 < Ax, By, Cz &le; 10) and (0 &le; Bx, Cx, Cy &le; 10).

출력

The single line of output contains four decimal values to four decimal places: centerxcenter_x, centerycenter_y, centerzcenter_z and radiusradius 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
코드를 제출하려면 로그인하세요.