题解:UVA11178 Morley's Theorem
wangbinfeng · · 题解
比较板的一道题,为了便于阅读,把题面再放一遍:
显而易见,如果求出
考虑点
可以发现,直线
显然,直线
附代码:
#include<bits/stdc++.h>
//此处是点类和向量类的模板,具体可见:https://www.luogu.com/article/p0k8bxnp
Point<double>a,b,c,d,e,f;
int x,y;
template<typename T>Point<T> getD(const Point<T>&a,const Point<T>&b,const Point<T>&c){
Vector<T>v1=c-b,v2=b-c;
T a1=(a-b).angle(v1),a2=(a-c).angle(v2);
return getLineIntersection(b,v1<<(a1/3),c,v2>>(a2/3));
}
signed main(){
static int T=-1;
if(T==-1)scanf("%d",&T);
if(T--==0)return 0;
scanf("%d%d",&x,&y),a=Point<double>(x,y);
scanf("%d%d",&x,&y),b=Point<double>(x,y);
scanf("%d%d",&x,&y),c=Point<double>(x,y);
d=getD(a,b,c),e=getD(b,c,a),f=getD(c,a,b);
printf("%.6lf %.6lf %.6lf %.6lf %.6lf %.6lf\n",d.x,d.y,e.x,e.y,f.x,f.y);
main();
}