因为两段圆弧在同一个圆上,所以该圆是矩形的外接圆,由此可通过圆心角解得两段圆弧长,设矩形的长为x,宽为y,列出方程可解得:

x = 400.0 / ( 2.0 + ( 2.0 * atan( b / a ) * sqrt( a*a + b*b ) ) / a )

y = x * b / a;

 1 #include <cstdio>
 2 #include <cmath>
 3 #include <algorithm>
 4 
 5 using namespace std;
 6 
 7 int main()
 8 {
 9     int cas = 0;
10     double a, b;
11     while( ~scanf( "%lf : %lf", &a, &b ) )
12     {
13         double x = 400.0 / ( 2.0 + ( 2.0 * atan( b / a ) * sqrt( a*a + b*b ) ) / a );
14         double y = x * b / a;
15         printf( "Case %d: ", ++cas );
16         printf( "%.10f %.10f\n", x, y );
17     }
18     return 0;
19 }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-21
  • 2021-09-25
  • 2021-07-10
  • 2021-08-09
  • 2021-09-28
  • 2021-09-30
猜你喜欢
  • 2022-12-23
  • 2021-11-14
  • 2021-09-01
  • 2021-09-23
  • 2021-11-28
  • 2021-10-23
  • 2021-08-25
相关资源
相似解决方案