UVa11178 - Morley's Theorem(向量旋转+直线交点)
2017-10-16 15:42
363 查看
题目链接
简介:三角形内角三等分线相交形成等边三角形
分析:
向量旋转和直线交点的练习
tip
新操作的第一次练习,板子不要写错
简介:三角形内角三等分线相交形成等边三角形
分析:
向量旋转和直线交点的练习
tip
新操作的第一次练习,板子不要写错
#include<cstdio> #include<cstring> #include<iostream> #include<cmath> using namespace std; struct node{ double x,y; node (double xx=0,double yy=0) { x=xx;y=yy; } }; node operator + (const node &a,const node &b){return node(a.x+b.x,a.y+b.y);} node operator - (const node &a,const node &b){return node(a.x-b.x,a.y-b.y);} node operator * (const node &a,const double &b){return node(a.x*b,a.y*b);} node operator / (const node &a,const double &b){return node(a.x/b,a.y/b);} double Dot(node x,node y){return x.x*y.x+x.y*y.y;} double Len(node x){return sqrt(Dot(x,x));} double Angle(node x,node y){ return acos( Dot(x,y)/Len(x)/Len(y) ); } double Cross(node x,node y){return x.x*y.y-x.y*y.x;} node rotate(node x,double a) { return node(x.x*cos(a)-x.y*sin(a),x.x*sin(a)+x.y*cos(a)); } node getpoint(node P,node v,node Q,node w) { node u=P-Q; double t=Cross(w,u)/Cross(v,w); return P+v*t; } node get(node A,node B,node C) { node X=C-B; double a=Angle(A-B,X); X=rotate(X,a/3); node Y=B-C; double b=Angle(A-C,Y); Y=rotate(Y,-b/3); //负数表示顺时针转动 return getpoint(B,X,C,Y); } int main() { node A,B,C,D,E,F; int T; scanf("%d",&T); while (T--) { scanf("%lf %lf",&A.x,&A.y); scanf("%lf %lf",&B.x,&B.y); scanf("%lf %lf",&C.x,&C.y); D=get(A,B,C); E=get(B,C,A); F=get(C,A,B); printf("%0.6lf %0.6lf %0.6lf %0.6lf %0.6lf %0.6lf\n",D.x,D.y,E.x,E.y,F.x,F.y); } return 0; }
相关文章推荐
- UVA 11178 || Morley's Theorem (向量旋转求交点
- Uva 11178 Morley's Theorem 向量旋转+求直线交点
- UVa 11178 Morley's Theorem (向量旋转)
- UVA 11178 Morley’s Theorem(计算几何直线的交点)
- uva 11178 - Morley's Theorem (直线旋转相交)
- UVA 11178 Morley's Theorem(旋转+直线交点)
- Morley’s Theorem - UVa 11178 求直线交点
- UVa 11178:Morley’s Theorem(两射线交点)
- UVA 11178 - Morley's Theorem 向量
- uva 11178 Morley's Theorem 三角形内角三等分线交点
- uva 11178 Morley's Theorem(计算几何-点和直线)
- uva 11178 Morley's Theorem(计算几何-点和直线)
- uva 11178 Morley's Theorem 计算几何
- UVA 11178 - Morley's Theorem(计算几何)
- Uva 11178 Morley's Theorem (几何+模拟)
- uvalive 7366(二分 + 两向量的交点 + 向量的旋转)
- UVA 11178 - Morley's Theorem 向量
- UVa 11178 Morley's Theorem(几何)
- 莫利定理:UVa 11178 Morley's Theorem
- UVA 11178 Morley's Theorem(二维几何基础)