题意:求三角形内∠MPB+∠APC=∠MPC+∠APB的轨迹长度- -
1.基于M的中垂线 2.三角形内的圆弧(比赛只有看自己能否猜中),ps.以下是别人家的证明
#include <stdio.h> #include <string.h> #include <iostream> #include <algorithm> #include <vector> #include <queue> #include <set> #include <map> #include <string> #include <math.h> #include <stdlib.h> #include <time.h> using namespace std; typedef long long ll; int main() { int T; scanf("%d",&T); int cas = 1; while(T--) { double a1,a2,b1,b2,c1,c2; scanf("%lf%lf%lf%lf%lf%lf",&a1,&a2,&b1,&b2,&c1,&c2); double Tab = (a1-b1)*(a1-b1)+(a2-b2)*(a2-b2); //ab double ab = sqrt(Tab); double Tbc = (b1-c1)*(b1-c1)+(b2-c2)*(b2-c2); //bc double bc = sqrt(Tbc); double h = sqrt(Tab - Tbc/4); double angle = acos(bc / (ab*2.0)); double R = bc / sin(angle); double ans = 0; ans = ans +h + R*angle; printf("Case #%d: %.4f ",cas++,ans); } }