Explore Track of Point

Time Limit: 1 Sec

Memory Limit: 256 MB

题目连接

http://acm.hdu.edu.cn/showproblem.php?pid=5476

Description

In Geometry, the problem of track is very interesting. Because in some cases, the track of point may be beautiful curve. For example, in polar Coordinate system, ρ=cos3θ is like rose, ρ=1−sinθ is a Cardioid, and so on. Today, there is a simple problem about it which you need to solve.

Give you a triangle ΔABC and AB = AC. M is the midpoint of BC. Point P is in ΔABC and makes min{∠MPB+∠APC,∠MPC+∠APB} maximum. The track of P is Γ. Would you mind calculating the length of Γ?

Given the coordinate of A, B, C, please output the length of Γ.

Input

There are T (1≤T≤104) test cases. For each case, one line includes six integers the coordinate of A, B, C in order. It is guaranteed that AB = AC and three points are not collinear. All coordinates do not exceed 104 by absolute value.

Output

For each case, first please output "Case #k: ", k is the number of test case. See sample output for more detail. Then, please output the length of Γ with exactly 4 digits after the decimal point.

Sample Input

1
0 1 -1 0 1 0

 

Sample Output

Case #1: 3.2214

HINT

题意

给你一个等腰三角形,底边中点叫做M,找一个点P的轨迹

使得  {∠MPB+∠APC,∠MPC+∠APB} 的最小值最大,问这个轨迹的长度是多少,这个轨迹必须在三角形内

题解:

下面这个圆弧再加上垂线的长度就好了

证明是转载的

代码:

//qscqesze
#pragma comment(linker, "/STACK:1024000000,1024000000")
#include <cstdio>
#include <cmath>
#include <cstring>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <set>
#include <bitset>
#include <vector>
#include <sstream>
#include <queue>
#include <typeinfo>
#include <fstream>
#include <map>
#include <stack>
typedef long long ll;
using namespace std;
//freopen("D.in","r",stdin);
//freopen("D.out","w",stdout);
#define sspeed ios_base::sync_with_stdio(0);cin.tie(0)
#define maxn 100006
#define mod 1000000007
#define eps 1e-9
#define e exp(1.0)
#define PI acos(-1)
const double EP = 1E- ;
int Num;
//const int inf=0x7fffffff;
const ll inf=;
inline ll read()
{
ll x=,f=;char ch=getchar();
while(ch<''||ch>''){if(ch=='-')f=-;ch=getchar();}
while(ch>=''&&ch<=''){x=x*+ch-'';ch=getchar();}
return x*f;
}
//************************************************************************************* int main()
{
int t=read();
for(int cas=;cas<=t;cas++)
{
double x1,y1,x2,y2,x3,y3;
scanf("%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3);
double a = sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
double b = sqrt((x1-x3)*(x1-x3)+(y1-y3)*(y1-y3));
double c = sqrt((x2-x3)*(x2-x3)+(y2-y3)*(y2-y3)); double k = acos((a*a+b*b-c*c)/(2.0*a*b)); double ans = cos(0.5*k)*a;
//cout<<k<<endl;
double h = cos(0.5*k)*a;
double r = (a*c)/(h*2.0);
ans += r*((double)PI-k);
/*
if(k<=PI/2.0)
ans += k*a;
else
{
double aa = a;
double bb = cos(0.5*k)*a;
double cc = c/2.0; double h = 2.0*bb*cc/aa;
double kk = acos(h/aa);
double kkk = k - 4.0*kk;
kkk = max(0.0,kkk);
ans += kkk*a;
}
*/
printf("Case #%d: %.4lf\n",cas,ans);
}
}

HDU 5476 Explore Track of Point 数学平几的更多相关文章

  1. hdu 5476 Explore Track of Point(2015上海网络赛)

    题目链接:hdu 5476 今天和队友们搞出3道水题后就一直卡在这儿了,唉,真惨啊……看着被一名一名地挤出晋级名次,确实很不好受,这道恶心的几何题被我们3个搞了3.4个小时,我想到一半时发现样例输出是 ...

  2. HDU 4342——History repeat itself——————【数学规律】

    History repeat itself Time Limit: 1000ms Memory Limit: 32768KB This problem will be judged on HDU. O ...

  3. hdu 1597 find the nth digit (数学)

    find the nth digit Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Other ...

  4. ACM学习历程—HDU5476 Explore Track of Point(平面几何)(2015上海网赛09题)

    Problem Description In Geometry, the problem of track is very interesting. Because in some cases, th ...

  5. HDU 6659 Acesrc and Good Numbers (数学 思维)

    2019 杭电多校 8 1003 题目链接:HDU 6659 比赛链接:2019 Multi-University Training Contest 8 Problem Description Ace ...

  6. HDU 5019 Revenge of GCD(数学)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5019 Problem Description In mathematics, the greatest ...

  7. hdu 4091 Zombie’s Treasure Chest(数学规律+枚举)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4091 /** 这题的一种思路就是枚举了: 基于这样一个事实:求出lcm = lcm(s1,s2), n ...

  8. HDU 4099 Revenge of Fibonacci (数学+字典数)

    传送门:http://acm.hdu.edu.cn/showproblem.php?pid=4099 这个题目就是一个坑或. 题意:给你不超过40的一串数字,问你这串数字是Fibonacci多少的开头 ...

  9. hdu 3232 Crossing Rivers(期望 + 数学推导 + 分类讨论,水题不水)

    Problem Description   You live in a village but work in another village. You decided to follow the s ...

随机推荐

  1. poj1026Cipher(置换群)

    链接 找循环节 然后所有子循环节的最小公倍数就是总的循环节 找结果的时候也按一个个置换来进行转换 不然也TLE #include <iostream> #include<cstdio ...

  2. poj 1416 Shredding Company( dfs )

    我的dfs真的好虚啊……,又是看的别人的博客做的 题目== 题目:http://poj.org/problem?id=1416 题意:给你两个数n,m;n表示最大数,m则是需要切割的数. 切割m,使得 ...

  3. DataTable导出到Excel(.NET 4.0)

    最近在论坛里又看到很多关于DataTable(DataSet)导入Excel的帖子,我也温故知新一下,用VS2010重新整理了一个Sample.这个问题简化一下就是内存数据到文件,也就是遍历赋值,只不 ...

  4. JQuery安全分析

    JQuery安全分析: JQuery的风险均来源于对输入的数据没有进行有效性检验.客户端的Javascript需要检验:来源于服务器的数据.来源于当前页面的用户输入,服务器端需要检验来源于用户端的数据 ...

  5. POJ 3678 Katu Puzzle (2-SAT,常规)

    题意:给出n个点,每个点上有一个数字可以0或1,然后给出m条限制,要求a和b两个点上的数字满足 a op b = c,op和c都是给定.问是否能够有一组解满足所有限制?(即点上的数字是0是1由你决定) ...

  6. java惯用法转载

    目录 实现: equals() hashCode() compareTo() clone() 应用: StringBuilder/StringBuffer Random.nextInt(int) It ...

  7. SharePoint 2010 master page 控件介绍(5):其他

    转:http://blog.csdn.net/lgm97/article/details/6409227 <!-- 处理搜索按下"enter"键和点击后退按钮 --> ...

  8. Spring注释@Qualifier

    在学习@Autowired的时候我们已经接触到了@Qualifier, 这节就来详细学习一下自定义@Qualifier. 例如定义一个交通工具类:Vehicle,以及它的子类Bus和Sedan. 如果 ...

  9. android中GridView关于间距的属性值介绍

    android:columnWidth  设置列的宽度.关联的方法为:setColumnWidth(int)  stretchMode属性值的作用是设置GridView中的条目以什么缩放模式去填充空间 ...

  10. WebDriver打开浏览器-java

    环境:配置jdk.使用Eclipse(个人爱好),导入selenium-java-2.42.2.jar.selenium-java-2.42.2-srcs.jar.selenium-server-st ...