Question: We know the radius of two tangent circles R1 and R2, which are switched to a large circle R at the same time,
The length of the cut line segment intercepted by a large circle after two small circles is t, and the area of the large circle minus the area of the two small circles is calculated.
Analysis: calculates the ry. The question shows the following equations:
R = R1 + R2;
T ^ 2 = 4 (R ^ 2-(r2-r1) ^ 2) = 4r1r2;
Sort and obtain:
S = π (R ^ 2-R1 ^ 2-R2 ^ 2) = π 2r1r2 = π t ^ 2/8.
Note: There seems to be no invalid data (⊙ _ ⊙ ).
#include <iostream> #include <cstdlib>#include <cstdio>#include <cmath>using namespace std;double pi = 2.0*acos(0.0),a,b;char buf[101];int main(){int n;while (cin >> n) {getchar();while (n --) {gets(buf);if (sscanf(buf, "%lf%lf", &a,&b) == 1) {if (a >= 0)printf("%.4lf\n",pi*a*a*0.125);else printf("Impossible.\n");}else {if (a >= 0 && b >= 0)printf("%.4lf\n",pi*a*b*2.0);else printf("Impossible.\n");}}}return 0;}
S = π (R ^ 2-R1 ^ 2-R2 ^ 2 );
Ultraviolet A 10573-geometry Paradox