UVa 11524 - In-Circle

不需要算法,几何计算题。方法如同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;
}


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值