For each case, if there is no shade on the plane, print “0.00”.
If the area of the shade is infinite, print “Infi”.
Otherwise, print out the area of the shade. Please round the result to two digits after the decimal point.
Hint
Here are some hints to help you implement rotation in 3-dimensional space.
Assume that there is a plane ax+by+cz=0 , and our task is to rotate the whole space so that the plane will be in the position z=0 .
As we all know, the normal vector of the plane is (a,b,c) , so after we rotate the space, the normal vector will be the z-axis. So we can only consider how to rotate the vector to the position
.
We can divide the process into 2 steps. First step, rotate the normal vector to
. Second step, rotate
to
. Then apply the two rotation steps on the whole space, we can rotate the plane to a given position.
It is easy to implement the two steps. In first step, the third number in the normal vector does not change, so this is like rotation in a 2-dimensional space. Similarly, we implement the second step.