您的位置:首页 > 其它

UVa 11524 - In-Circle

2013-07-20 09:56 309 查看
不需要算法,几何计算题。方法如同Ac_coral http://www.cnblogs.com/Accoral/p/3142038.html

/*************************************************************************
> File Name: UVa11524.cpp
> Author: AcToy
> Mail: ycsgldy@163.com
> Created Time: 2013年07月20日 星期六 09时26分36秒
************************************************************************/

#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 Case;
double R, m1, n1, m2, n2, m3, n3, x;
scanf("%d", &Case);
while(Case--) {
scanf("%lf", &R);
scanf("%lf%lf%lf%lf%lf%lf", &m1, &n1, &m2, &n2, &m3, &n3);
double tmp1 = n1 / m1, tmp2 = m3 / n3;
double ang1 = acos((tmp1 + tmp2 + 1 - tmp1 * tmp2) / ((tmp1 + 1) * (tmp2 + 1)));
double ang2 = ang1 / 2;
double x = R / tan(ang2);
double C = x * 2 + 2 * x * n1 / m1 + 2 * x * m3 / n3;
printf("%.4lf\n", R * C / 2);
}
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: