题目传送门 题意:莫雷定理,求三个点的坐标 分析:训练指南P259,用到了求角度,向量旋转,求射线交点 /************************************************ * Author :Running_Time * Created Time :2015/10/21 星期三 15:56:27 * File Name :UVA_11178.cpp ************************************************/ #include…
题目传送门 题意:三角形三等分点连线组成的三角形面积 分析:入门题,先求三等分点,再求交点,最后求面积.还可以用梅涅劳斯定理来做 /************************************************ * Author :Running_Time * Created Time :2015/10/22 星期四 12:55:27 * File Name :UVA_11437.cpp *********************************************…
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2119 11178 - Morley's Theorem Time limit: 3.000 seconds Problem DMorley’s TheoremInput: Standard Input Output: Standard Output Morley’s theorem stat…
Morley's Theorem [题目链接]Morley's Theorem [题目类型]几何 &题解: 蓝书P259 简单的几何模拟,但要熟练的应用模板,还有注意模板的适用范围和传参不要传混了 &代码: #include <bits/stdc++.h> using namespace std; #define INF 0x3f3f3f3f typedef long long ll; const int maxn= 1e3 +7; //蓝书P255 //1.点的定义 stru…
Problem DMorley’s TheoremInput: Standard Input Output: Standard Output Morley’s theorem states that that the lines trisecting the angles of an arbitrary plane triangle meet at the vertices of an equilateral triangle. For example in the figure below t…
题目链接:UVA 11178 Description Input Output Sample Input Sample Output Solution 题意 \(Morley's\ theorem\) 指任意三角形的每个内角的三等分线相交的三角形为等边三角形. 给出三角形的每个点的坐标,求根据 \(Morley's\ theorem\) 构造的等边三角形的三个点的坐标. 题解 对于点 \(D\),只需求直线 \(BC\) 绕点 \(B\) 旋转 \(\frac{1}{3} \angle ABC\…
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2119 题目大意: Morley定理是这样定义的,做三角形ABC每个内角的三等分线,相交成三角形DEF,则DEF是等边三角形.如图,你的任务是根据A,B,C三个点的位置确定D.E.F的位置. 思路: 把BC边旋转三分之一的角ABC,CB边旋转三分之一的角ACB,然后求交点D就出来了.其他的同理…
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=9 题意: Morlery定理是这样的:作三角形ABC每个内角的三等分线.相交成三角形DEF.则DEF为等边三角形,你的任务是给你A,B,C点坐标求D,E,F的坐标 思路: 根据对称性,我们只要求出一个点其他点一样:我们知道三点的左边即可求出每个夹角,假设求D,我们只要将向量BC 旋转rad/3的到直线BD,然后旋转向量CB然后得到CD,然后就是求两直线的交点了.…
题意:给定三角形的三个点,让你求它每个角的三等分线所交的顶点. 析:根据自己的以前的数学知识,应该很容易想到思想,比如D点,就是应该求直线BD和CD的交点, 以前还得自己算,现在计算机帮你算,更方便,主要注意的是旋转是顺时针还是逆时针,不要搞错了. 要求BD和CD就得先求那个夹角ABC和ACD,然后三等分. 代码如下: #include <iostream> #include <cstdio> #include <cstring> #include <cmath&…
题目链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=18543 [思路] 旋转+直线交点 第一个计算几何题,照着书上代码打的. [代码] #include<cstdio> #include<cmath> #include<cstring> using namespace std; struct Pt { double x,y; Pt(,):x(x),y(y) {} }; typedef Pt…
题意:训练指南259页 #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> using namespace std; const double eps=1e-8; int dcmp(double x) { if(fabs(x)<eps) return 0; else return (x<0)?-1:…
题目链接 lrj训练指南 P259 //==================================================================== Point getP(Point A,Point B,Point C) { double a1=Angle(A-B,C-B); Vector v1=Rotate(C-B,a1/); double a2=Angle(A-C,B-C); Vector v2=Rotate(B-C,-a2/); return GetLineIn…
Problem D Morley's Theorem Input: Standard Input Output: Standard Output Morley's theorem states that that the lines trisecting the angles of an arbitrary plane triangle meet at the vertices of an equilateral triangle. For example in the figure below…
A #include <bits/stdc++.h> #define PI acos(-1.0) #define mem(a,b) memset((a),b,sizeof(a)) #define TS printf("!!!\n") #define pb push_back #define inf 1e9 //std::ios::sync_with_stdio(false); using namespace std; //priority_queue<int,vect…
题目传送门 题意:一笔画,问该图形将平面分成多少个区域 分析:训练指南P260,欧拉定理:平面图定点数V,边数E,面数F,则V + F - E =  2.那么找出新增的点和边就可以了.用到了判断线段相交,求交点,判断点在线上 /************************************************ * Author :Running_Time * Created Time :2015/10/22 星期四 09:10:09 * File Name :LA_3263.cpp…
题目传送门 题意:找一条直线,使得其余的点都在直线的同一侧,而且使得到直线的平均距离最短. 分析:训练指南P274,先求凸包,如果每条边都算一边的话,是O (n ^ 2),然而根据公式知直线一般式为Ax + By + C = 0.点(x0, y0)到直线的距离为:fabs(Ax0+By0+C)/sqrt(A*A+B*B). 所以只要先求出x的和以及y的和,能在O (1)计算所有距离和. 两点式直线方程p1 (x1, y1),p2 (x2, y2)转换成一般式直线方程:A = y1 - y2, B…
题目传送门 题意:判断一些点的凸包能否唯一确定 分析:如果凸包边上没有其他点,那么边想象成橡皮筋,可以往外拖动,这不是唯一确定的.还有求凸包的点数<=2的情况一定不能确定. /************************************************ * Author :Running_Time * Created Time :2015/11/4 星期三 10:24:45 * File Name :POJ_1228.cpp *************************…
题目传送门 题意:给了四个点,判断能构成什么图形,有优先规则 分析:正方形和矩形按照点积为0和长度判断,菱形和平行四边形按向量相等和长度判断,梯形按照叉积为0判平行.因为四个点是任意给出的,首先要进行凸包排序,可能会有三点共线的情况. /************************************************ * Author :Running_Time * Created Time :2015/10/22 星期四 13:27:33 * File Name :UVA_11…
题意: 给你三角形三个点, 定理是 三个内角的三等分线相交得出 DEF三点, 三角新 DFE是等边三角形 然后要你输出 D E F 的坐标 思路 : 求出三个内角,对于D 相当于 BC向量逆时针旋转, CB向量顺时针旋转 ,相交得到的点: 同理可以求出其他点  (LRJ 模板真强大) #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<cm…
题目传送门 题意:给了长宽比例,操场一圈400米,问原来长宽的长度 分析:推出公式 /************************************************ * Author :Running_Time * Created Time :2015/10/22 星期四 15:19:59 * File Name :UVA_11646.cpp ************************************************/ #include <cstdio>…
题意: Morley定理:任意三角形中,每个角的三等分线,相交出来的三个点构成一个正三角形. 不过这和题目关系不大,题目所求是正三角形的三个点的坐标,保留6位小数. 分析: 由于对称性,求出D点,EF也是同样的. 用点和向量的形式表示一条直线,向量BA.BC的夹角为a1,则将BC逆时针旋转a1/3可求得 直线BD,同理也可求得直线CD,最后再求交点即可. //#define LOCAL #include <cstdio> #include <cstring> #include &l…
Problem D Morley’s Theorem Input: Standard Input Output: Standard Output Morley’s theorem states that that the lines trisecting the angles of an arbitrary plane triangle meet at the vertices of an equilateral triangle. For example in the figure below…
题目传送门 题意:有两个一大一小的同心圆,圆心在原点,大圆外有一小圆,其圆心有一个速度(vx, vy),如果碰到了小圆会反弹,问该圆在大圆内运动的时间 分析:将圆外的小圆看成一个点,判断该直线与同心圆的交点,根据交点个数计算时间.用到了直线的定义,圆的定义,直线与圆交点的个数. /************************************************ * Author :Running_Time * Created Time :2015/10/24 星期六 16:14:…
[2020 BUAA 软件工程]结对项目作业 项目 内容 课程:北航2020春软件工程 博客园班级博客 作业:阅读并撰写博客回答问题 结对项目作业 我在这个课程的目标是 积累两人结对编程过程中的经验 这个作业在哪个具体方面帮助我实现目标 体验两人结对编程过程,努力提高沟通效率和代码匹配度 1. 项目地址 教学班级:006 项目地址:https://github.com/blackbird52/IntersectProject 目录结构: IntersectProject/ ├── bin │ ├…
Morley’s Theorem Input: Standard Input Output: Standard Output Morley’s theorem states that that the lines trisecting the angles of an arbitrary plane triangle meet at the vertices of an equilateral triangle. For example in the figure below the tri-s…
思路来自于:http://www.cnblogs.com/wuyiqi/archive/2011/11/06/2238530.html 枚举两个多边形的两个点组成的直线,判断能与几个多边形相交 因为最佳的直线肯定可以经过某两个点(可以平移到顶点处),所以暴力枚举两个点就好了 如果有模版的话,写代码就快多了. 代码如下: #include <cstdio> #include <cstring> #include <cstdlib> #include <algorit…
题目传送门 题意:判断给定的多边形是否为凸的,peg(pig?)是否在多边形内,且以其为圆心的圆不超出多边形(擦着边也不行). 分析:判断凸多边形就用凸包,看看点集的个数是否为n.在多边形内用叉积方向来判断,最后再用点到直线的距离和半径比大小(不是线段) /************************************************ * Author :Running_Time * Created Time :2015/11/2 星期一 19:49:13 * File Nam…
题目传送门 题意:一根管道,有光源从入口发射,问光源最远到达的地方. 分析:黑书上的例题,解法是枚举任意的一个上顶点和一个下顶点(优化后),组成直线,如果直线与所有竖直线段有交点,则表示能穿过管道. /************************************************ * Author :Running_Time * Created Time :2015/10/31 星期六 10:28:12 * File Name :POJ_1039.cpp ***********…
题目传送门 题意:一个矩形和一条线段,问是否有相交 分析:考虑各种情况.坑点:给出的矩形的两个端点是无序的,还有线段完全在矩形内也算相交 /************************************************ * Author :Running_Time * Created Time :2015/10/27 星期二 13:17:49 * File Name :POJ_1410.cpp ******************************************…
题目传送门 题意:求最短路线,使得线上任意一点离城堡至少L距离 分析:先求凸包,答案 = 凸包的长度 + 以L为半径的圆的周长 /************************************************ * Author :Running_Time * Created Time :2015/10/25 11:00:48 * File Name :POJ_1113.cpp ************************************************/ #…