Flat Earth
Time limit2sMemory limit512 MB
Given a sphere and a plane, compute the area of the sphere's orthogonal projection onto the plane.
- Level
Medium6 of 10
- Topics
- Geometry, Math, Implementation, Brute force
- Solved
- No attempts yet
Problem
The education system has let you down once again. Your proposal to include the Flat Earth model in the high school curriculum has been rejected for the sixth time in a row. The corrupt Round-Earth scientists refuse to listen to your arguments and ignore the piles of data that support your claims. It is time to settle this conflict once and for all. You have traveled all around the globe and met with top Flat Earth scientists. Together you devised a brilliant plan.
For the sake of contradiction, suppose that Earth is a sphere in three-dimensional space. Then, assuming the sky is an infinite plane in that space, such an Earth would clearly cast a shadow on it. This shadow would be an orthogonal projection of Earth onto the sky. Since in reality there is no visible shadow on the sky, we reach a contradiction.
All that is left is to perform the calculations. Given the center and radius of Earth, along with the equation of the sky plane in the form , determine the area of an orthogonal projection of Earth onto the sky. Note that in some of your experiments Earth may intersect the sky. You would not want to introduce too many unnecessary assumptions, would you?
Input
The first line of input contains the number of test cases (). The descriptions of the test cases follow.
Every test case is described by a line containing eight integers , , , , , , , . They denote the coordinates of Earth's center, its radius, and the sky's equation, respectively. All numbers are between 1 and 1000 inclusive.
Output
For each test case, output one number: the area of the projection. Your answer will be considered correct if the absolute or relative error does not exceed .