hdu5476 Explore Track of Point(数学)
来源:互联网 发布:怎么样抓取精准数据库 编辑:程序博客网 时间:2024/05/16 17:30
思路:一道纯平面几何题....显然AM是成立的,然后猜测剩下的是与AB,AC相切的圆的劣弧...就做完了...
#include<bits/stdc++.h>using namespace std;double dis(double x1,double y1,double x2,double y2){ return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));}int main(){ int T,cas=1; scanf("%d",&T); while(T--) { printf("Case #%d: ",cas++); double ax,ay,bx,by,cx,cy; scanf("%lf%lf%lf%lf%lf%lf",&ax,&ay,&bx,&by,&cx,&cy); double mx = (cx+bx)/2; double my = (cy+by)/2; double am = dis(ax,ay,mx,my); double r = dis(bx,by,mx,my)/dis(ax,ay,mx,my)*dis(ax,ay,bx,by); double ang = atan(dis(ax,ay,bx,by)/r); printf("%.4f\n",am+2*ang*r); }}
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Γ .
Give you a triangle
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
10 1 -1 0 1 0
Sample Output
Case #1: 3.2214
0 0
- hdu5476 Explore Track of Point(数学)
- HDU5476 Explore Track of Point 几何题
- HDU5476 Explore Track of Point【计算几何】
- hdu5476 Explore Track of Point 2015上海网络赛
- HDU 5476 Explore Track of Point(平面几何)
- HDU 5476 Explore Track of Point(平面几何)
- hdu 5476 Explore Track of Point(几何)
- HDU 5476 Explore Track of Point
- HDU 5476 Explore Track of Point
- hdu 5476 Explore Track of Point
- HDU 5476 Explore Track of Point (2015上海站网赛1009)
- HDU 5476 Explore Track of Point (2015年上海赛区网络赛I题)
- hdoj 5476 Explore Track of Point 【托勒密定理】
- hdu 5476 Explore Track of Point 2015上海网络赛 几何
- HDU 5476 Explore Track of Point(几何)——2015 ACM/ICPC Asia Regional Shanghai Online
- HDU 5476 Explore Track of Point 2015上海网络赛 几何题
- HDU 5476 Explore Track of Point 几何题 —— 2015 ACM/ICPC Asia Regional Shanghai Online
- hdu5476Explore Track of Point+平面几何
- Fortran含Module情况下Makefile文件书写
- hdu5478 Can you find it(数学)
- Java-NowCoder-计算字符个数
- spark mllib Matrices CSC
- 求全排列的4种情况
- hdu5476 Explore Track of Point(数学)
- 阿里笔试题
- hdu5477 A Sweet Journey(水)
- panic: reflect.Value.Interface: cannot return value obtained from unexported field or method
- C++ TCP 和 UDP 在socket编程中的区别
- hdu5469 Antonidas(DFS)
- HHUOJ 1014 火眼金睛(另类思路题)
- 二进制dat格式数据转十六进制输出
- intel cpu