uva-10250-The Other Two Trees
2012-07-27 14:41
309 查看
这道题目做完了,UVA训练计划的第一单元作玩了,继续作第二单元。
这道题目已经积压很长事件了,原因是怎么也读不懂题意,所以没法下手。
今天又看了一遍,想了想,还是硬做吧,结果对了。。。
就是两条互相垂直平分的线段,已知一条线段的两端,求另外一条线段的两点;
这道题目已经积压很长事件了,原因是怎么也读不懂题意,所以没法下手。
今天又看了一遍,想了想,还是硬做吧,结果对了。。。
就是两条互相垂直平分的线段,已知一条线段的两端,求另外一条线段的两点;
#include<stdio.h> #include<string.h> #include<math.h> int main() { double sin,cos,l; double x1,x2,x3,x4,x; double y1,y2,y3,y4,y; while(scanf("%lf%lf%lf%lf",&x1,&y1,&x2,&y2)!=EOF) { x=(x1+x2)/2; y=(y1+y2)/2; l=sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)); sin=(y2-y1)/l; cos=(x2-x1)/l; x3=x-l*sin*0.5; y3=y+l*cos*0.5; x4=x+l*sin*0.5; y4=y-l*cos*0.5; printf("%.10lf %.10lf %.10lf %.10lf\n",x3,y3,x4,y4); } return 0; }
相关文章推荐
- UVa 10250 - The Other Two Trees
- UVA 10250 The Other Two Trees
- UVA-10250 The Other Two Trees
- UVa 10250 The Other Two Trees
- uva_10250 - The Other Two Trees
- UVa 10250 - The Other Two Trees
- UVa 10250 The Other Two Trees (计算几何)
- UVa 10250 The Other Two Trees(数学问题)
- UVA 10250 The Other Two Trees
- UVA 10250 The Other Two Trees
- UVa 10250 The Other Two Trees
- uva 10250 - The Other Two Trees
- UVA10250 - The Other Two Trees
- UVa 10250 - The Other Two Trees
- UVA - 10250 The Other Two Trees
- UVA 10250-The Other Two Trees
- Uva 10250 - The Other Two Trees
- UVA10250-The Other Two Trees
- UVA 10250 - The Other Two Trees(几何)
- UVa 10250 The Other Two Trees