在圆中有个矩形,知道长:宽 = a : b。设一值x,这样我们可以求出圆半径R,2*R*x = sqrt(a*x*a*x +b*x*b*x),x可化简没,sin(ang1)= b / 2R,矩形对角划分的一个角,画出图来就会知道是那个角了,这个我可以求出圆弧所对应的圆心角为 ang = 2 * ang1 。所以200 = a * x + R * x *ang,可以求出x,这样长为a * x, 宽为b * x
/*************************************************************************
> File Name: UVa11646.cpp
> Author: AcToy
> Mail: ycsgldy@163.com
> Created Time: 2013年07月19日 星期五 17时51分24秒
************************************************************************/
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <climits>
#include <cstdio>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <stack>
#include <map>
#include <set>
using namespace std;
typedef unsigned int u32;
typedef long long i64;
typedef unsigned long long u64;
typedef vector<int> IV;
typedef vector<bool> BV;
typedef pair<int,int> II;
typedef vector<II> IIV;
#define For(t,v,c) for(t::const_iterator v=c.begin(); v!=c.end(); ++v)
const int INF = 0x7FFFFFFF;
const double eps = 1E-10;
const double PI = acos(-1);
int main() {
int a, b, kcase = 1;;
char c[10];
while(scanf("%d%s%d", &a, c, &b) == 3) {
double R = sqrt(a * a + b * b) / 2;
double ang = 2 * asin(b / (2 * R));
double tmp = 200 / (ang * R + a);
printf("Case %d: %.8lf %.8lf\n", kcase++, tmp * a, tmp * b);
}
return 0;
}