https://cn.vjudge.net/problem/UVA-11731
题目
有这么一个图形,圆和线相切,输入AB,AC,BC,求大三角形面积和阴影部分面积
题解
先证明BE垂直于DF,
把圆$D$缩小到和圆$F$一样,修改$AC$切于新圆,然后会发现对称性,然后就可以说明$BE$垂直于$DF$
其他两个一样
只是证明不太显然= =然后就是计算了
AC代码
#include<cstdio> #include<cmath> double geta(double a,double b,double c) {//余弦定理 return acos((-c*c+a*a+b*b)/(2*a*b)); } int main() { int a,b,c; int kase=0; while(~scanf("%d%d%d",&a, &b, &c) && a) { double p=(a+b+c)*0.5; double S=sqrt(p*(p-a)*(p-b)*(p-c)); double Aa=S*2/a,Cc=S*2/c,Bb=S*2/b; double r=2*S/(a+b+c); double Rf=r*Cc/(Cc-2*r); double Re=r*Bb/(Bb-2*r); double Rd=r*Aa/(Aa-2*r); double F=(M_PI-geta(a,b,c))/2; double E=(M_PI-geta(a,c,b))/2; double D=(M_PI-geta(b,c,a))/2; // printf("@%lf %lf %lf\n", D, E, F); double Sf=Rf*Rf/2*F, Se=Re*Re/2*E, Sd=Rd*Rd/2*D; double SF=c/sin(F)*sin(D)*c/2*sin(E);//正弦定理,如果用半角误差太大,会WA double SE=b/sin(E)*sin(D)*b/2*sin(F); double SD=a/sin(D)*sin(E)*a/2*sin(F); printf("Case %d: ", ++kase); printf("%.2lf %.2lf", S+SF+SE+SD, Sf+Se+Sd); putchar('\n'); } }