Problem 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

题目稍微转换一下就变成求∠MPB+∠APC=∠MPC+∠APB=180的点p的轨迹了。

这最后结论是一道平面几何题,高中数竞虽然搞过平面几何,不过基本全部忘光了,定理也只记得一个梅涅劳斯定理了。。。虽然当时就很弱。。

高中数竞时小烈平几就很强@hqwhqwhq,果然赛后题解交代了轨迹寻找的过程。。

http://blog.csdn.net/u014610830/article/details/48753415

虽然找的过程没怎么看懂,不过证明过程基本看懂了。

如果能猜出轨迹的话题目也就解决了,剩下就是怎么证明这个轨迹满足条件了。

首先三角形的高AM是满足条件的,基本是没问题的。

其次B和C点在极限情况下发现也是满足条件的,由于对称性,基本上剩余轨迹就是过B和C的一种图形。。。

运气好的话猜到它是个圆就能解决。。。

盗一张图:

结论是剩余的图是AB过B的垂线与AC过C的垂线交于点M,以M为圆心,BM为半径的圆弧。

接下来证明:

对于圆弧上某一点P,AP延长交圆于点D,

目测的话,∠BPM = ∠CPD。结论就是这个,接下来就是证明这个。

由于B、P、C、D四点共圆,根据托勒密定理:

CP*BD+BP*CD
= BC*DP

由根据割线定理:

AB*AB =
AP*AD

于是可得,三角形APB相似于三角形ABD

于是BP/BD
= AB/AD

同理得:CP/CD
= AC/AD

又AB=AC

于是BP/BD
= CP/CD

即BP*CD
= CP*BD

联合上面的托勒密得2BP*CD = 2CP*BD = BC*DP = 2BM*DP

提取BP*CD
= BM*DP

即BP/BM
= DP/CD

又∠MBP = ∠CDP(同弧所对圆周角相等)

于是三角形MBP相似于三角形CDP

于是结论得证。

代码:

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <string>
#define LL long long using namespace std; const double PI = acos(-); inline double dis(double xA, double yA, double xB, double yB)
{
double ans = (xA-xB)*(xA-xB) + (yA-yB)*(yA-yB);
return sqrt(ans);
} void work()
{
double xA, yA, xB, yB, xC, yC;
double a, h, d, ans, v, r;
scanf("%lf%lf%lf%lf%lf%lf", &xA, &yA, &xB, &yB, &xC, &yC);
d = dis(xB, yB, xC, yC)/;
h = dis(xA, yA, xB, yB);
a = asin(d/h);
v = PI-*a;
r = h*tan(a);
ans = sqrt(h*h-d*d)+v*r;
printf("%.4lf\n", ans);
} int main()
{
//freopen("test.in", "r", stdin);
int T;
scanf("%d", &T);
for (int times = ; times <= T; ++times)
{
printf("Case #%d: ", times);
work();
}
return ;
}

ACM学习历程—HDU5476 Explore Track of Point(平面几何)(2015上海网赛09题)的更多相关文章

  1. ACM学习历程—HDU 5446 Unknown Treasure(数论)(2015长春网赛1010题)

    Problem Description On the way to the next secret treasure hiding place, the mathematician discovere ...

  2. ACM学习历程——HDU5017 Ellipsoid(模拟退火)(2014西安网赛K题)

    ---恢复内容开始--- Description Given a 3-dimension ellipsoid(椭球面) your task is to find the minimal distanc ...

  3. ACM学习历程—HDU5478 Can you find it(数论)(2015上海网赛11题)

    Problem Description Given a prime number C(1≤C≤2×105), and three integers k1, b1, k2 (1≤k1,k2,b1≤109 ...

  4. ACM学习历程—HDU5475 An easy problem(线段树)(2015上海网赛08题)

    Problem Description One day, a useless calculator was being built by Kuros. Let's assume that number ...

  5. ACM学习历程—HDU 5025 Saving Tang Monk(广州赛区网赛)(bfs)

    Problem Description <Journey to the West>(also <Monkey>) is one of the Four Great Classi ...

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

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

  7. ACM学习历程—HDU 5459 Jesus Is Here(递推)(2015沈阳网赛1010题)

    Sample Input 9 5 6 7 8 113 1205 199312 199401 201314 Sample Output Case #1: 5 Case #2: 16 Case #3: 8 ...

  8. ACM学习历程—HDU 5451 Best Solver(Fibonacci数列 && 快速幂)(2015沈阳网赛1002题)

    Problem Description The so-called best problem solver can easily solve this problem, with his/her ch ...

  9. ACM学习历程—HDU 5443 The Water Problem(RMQ)(2015长春网赛1007题)

    Problem Description In Land waterless, water is a very limited resource. People always fight for the ...

随机推荐

  1. iOS基础动画的KeyPath取值

    一 .基础动画 1.基础动画的属性详解 注:Core Animation的动画执行过程都是在后台操作的,不会阻塞主线程. 属性 解读 Autoreverses 设定这个属性为 YES 时,在它到达目的 ...

  2. TRansportation ANalysis and SIMulation System

    https://www.fhwa.dot.gov/planning/tmip/transims/background.cfm?from=groupmessage

  3. C++, Java和C#的编译、链接过程解析

    总是感觉java是解释性语言,转载下一篇感觉写的容易理解的文章 转自 http://www.cnblogs.com/rush/p/3155665.html 1.1.1 摘要 我们知道计算机不能直接理解 ...

  4. 什么是GIL锁以及作用

    全局解释锁,每次只能一个线程获得cpu的使用权:为了线程安全,也就是为了解决多线程之间的数据完整性和状态同步而加的锁,因为我们知道线程之间的数据是共享的.

  5. IO多路复用的作用?并列举实现机制以及区别?

    I/O多路复用是用于提升效率,单个进程可以同时监听多个网络连接IO. 举例:通过一种机制,可以监视多个文件描述符,一旦描述符就绪(读就绪和写就绪),能通知程序进行相应的读写操作,I/O多路复用避免阻塞 ...

  6. READ_TEXT

    [转自http://lz357502668.blog.163.com/blog/static/1649674320109119101907/]这里,定义ITAB内表来存储长文本,并放到内表ITAB_E ...

  7. JVM性能优化, Part 1 ―― JVM简介

    JVM性能优化这些列文章共分为5章,是ImportNew上面翻译自Javaworld: 第1章:JVM技术概览 第2章:编译器 第3章:垃圾回收 第4章:并发垃圾回收 第5章:可伸缩性 众所周知,Ja ...

  8. Python字典的入门案例

    查看python版本: [root@localhost ~]# python -V Python 2.7.5 1.基本的字典操作 案例1:简单电话本实现 [root@localhost ~]# vim ...

  9. 查询某个字段为null并且某个字段不为null的数据

    查询代码为null且ggid不为null的公司名 select name_of_invested_company from dwtz WHERE code is NULL and ggid is no ...

  10. LeetCode:算法特辑——二分搜索

    LeetCode:算法特辑——二分搜索 算法模板——基础 int L =0; int R =arr.length; while(L<R) { int M = (R-L)/2+L; if(arr[ ...