题意: 给你三角形三个点, 定理是 三个内角的三等分线相交得出 DEF三点,

三角新 DFE是等边三角形

然后要你输出 D E F 的坐标

思路 :

求出三个内角,对于D 相当于 BC向量逆时针旋转, CB向量顺时针旋转 ,相交得到的点;

同理可以求出其他点  (LRJ 模板真强大)

#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
using namespace std;
const double eps = 1e-;
struct Point {
double x, y;
Point(double x = , double y = ) : x(x), y(y) {}
};
typedef Point Vector; int dcmp(double x) { if(fabs(x) < eps) return ; else return x < ? - : ; } Vector operator + (Vector A, Vector B) { return Vector(A.x+B.x, A.y+B.y) ; }
Vector operator - (Point A, Point B) { return Vector(A.x-B.x, A.y-B.y) ; }
Vector operator * (Vector A, double p) { return Vector(A.x*p, A.y*p ) ; }
Vector operator / (Vector A, double p) { return Vector(A.x/p, A.y/p ) ; }
bool operator == (const Point &a, const Point &b) {
return dcmp(a.x-b.x) == && dcmp(a.y-b.y) == ;
} double Dot (Vector A, Vector B) { return A.x*B.x + A.y*B.y; } ///点积
double Length (Vector A) { return sqrt(Dot(A,A)); } ///向量长度
double Angle (Vector A, Vector B) { return acos(Dot(A,B) / Length(A) / Length(B)); } ///角度
double Cross (Vector A, Vector B) { return A.x*B.y - A.y*B.x; } ///X积
double Area2 (Point A, Point B, Point C) { return Cross(B-A,C-A); } ///面积
Vector Rotate (Vector A, double rad) { ///向量旋转 , 逆时针,顺时针角度为-
return Vector(A.x*cos(rad)-A.y*sin(rad), A.x*sin(rad) + A.y*cos(rad)) ;
}
Vector Normal (Vector A) { double L = Length(A); return Vector(-A.y/L, A.x/L); } ///单位向量
Point GetLineIntersection (Point P, Vector v, Point Q, Vector w) {
Vector u = P - Q;
double t = Cross(w,u) / Cross(v,w);
return P + v*t;
} Point GetPoint (Point A, Point B, Point C)
{
Vector v = C-B;
double rad = Angle(A-B,v);
v = Rotate(v, rad/); Vector vv = B-C;
rad = Angle(A-C,vv);
vv = Rotate(vv, -rad/); return GetLineIntersection(B,v, C,vv);
} int main()
{
int t;
scanf("%d",&t);
while(t--)
{
Point A, B, C, D, E, F;
cin >> A.x >> A.y >> B.x >>B.y >> C.x >>C.y;
D = GetPoint(A,B,C);
E = GetPoint(B,C,A);
F = GetPoint(C,A,B);
printf("%.6lf %.6lf %.6lf %.6lf %.6lf %.6lf\n",D.x,D.y,E.x,E.y,F.x,F.y);
}
return ;
}

Uva 11178 Morley定理的更多相关文章

  1. uva 11178 - Morley's Theorem

    http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&p ...

  2. UVA 11178 - Morley's Theorem 向量

    http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&p ...

  3. UVA 11178 Morley's Theorem (坐标旋转)

    题目链接:UVA 11178 Description Input Output Sample Input Sample Output Solution 题意 \(Morley's\ theorem\) ...

  4. UVa 11178:Morley’s Theorem(两射线交点)

    Problem DMorley’s TheoremInput: Standard Input Output: Standard Output Morley’s theorem states that ...

  5. Uva 11178 Morley's Theorem 向量旋转+求直线交点

    http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=9 题意: Morlery定理是这样的:作三角形ABC每个 ...

  6. uva 11178 Morley&#39;s Theorem(计算几何-点和直线)

    Problem D Morley's Theorem Input: Standard Input Output: Standard Output Morley's theorem states tha ...

  7. UVA 11178 Morley's Theorem(几何)

    Morley's Theorem [题目链接]Morley's Theorem [题目类型]几何 &题解: 蓝书P259 简单的几何模拟,但要熟练的应用模板,还有注意模板的适用范围和传参不要传 ...

  8. 简单几何(求交点) UVA 11178 Morley's Theorem

    题目传送门 题意:莫雷定理,求三个点的坐标 分析:训练指南P259,用到了求角度,向量旋转,求射线交点 /*********************************************** ...

  9. UVA 11178 Morley's Theorem(旋转+直线交点)

    题目链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=18543 [思路] 旋转+直线交点 第一个计算几何题,照着书上代码打 ...

随机推荐

  1. 如何转换cdr文件

    You will need to copy the type library from corelDRAW: C:\Program Files (x86)\Corel\CorelDRAW Graphi ...

  2. linux磁盘空间占满问题快速定位并解决

    经常会遇到这样的场景:测试环境磁盘跑满了,导致系统不能正常运行!此时就需要查看是哪个目录或者文件占用了空间.常使用如下几个命令进行排查:df, lsof,du. 通常的解决步骤如下:1. df -h ...

  3. git 完全讲解 无废话,包含在myeclipse中使用,包括解决冲突

    Git 1. Git简介 1.1 git是什么 1.1.1概念 Git:git是一款开源的分布式的版本控制软件 Github:是一个基于git的面向开源及私有软件项目的托管平台 因仅支持git 作为唯 ...

  4. swift之函数式编程

    函数式编程初探 最近初学swift,和OC比,发现语言更现代,也有了更多的特性.如何写好swift代码,也许,熟练使用新特性写出更优秀的代码,就是答案.今天先从大的方向谈谈swift中的编程范式-函数 ...

  5. pyqt5-QWidget坐标系统和大小

    获取坐标和尺寸: 坐标的获取视频教程:https://v.qq.com/x/page/t085892mzh9.html  x()    y()   返回控件的坐标 相对于父控件的坐标(窗口框架左上角) ...

  6. vue找错

    第一,vue报错直接用浏览器的console查看,不用代码寻找: 第二,props继承父类之后,然后作用到注册组件,同一个时间不可以取值,因为props模板还没有值

  7. Java SE之I/O流:知识框架

  8. 使用flask_socketio实现客户端间即时通信

    前期没有来得及好好总结,现在复习总结一下: Socket.IO 背后主要的思想是你可以发送和接收想要的任何事件,携带你想要的任何数据.任何可以编码为 JSON 的对象都可以做到,并且也支持二进制数据. ...

  9. python 多线程小方法

    import time from multiprocessing import Process, Lock, JoinableQueue from multiprocessing import Sem ...

  10. springfox-swagger2

    简介 springfox是通过注解的形式自动生成API文档,利用它,可以很方便的书写restful API: swagger主要用于展示springfox生成的API文档: 依赖 <depend ...