题意:根据A,B,C三点的位置确定D,E,F三个点的位置。

贴模板

 #include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<memory.h>
#include<cstdlib>
#include<vector>
#define clc(a,b) memset(a,b,sizeof(a))
#define LL long long int
using namespace std;
const int N=;
const int inf=0x3f3f3f3f;
const double eps = 1e-; struct Point
{
double x, y;
Point(double x = , double y = ) : x(x), y(y) { }
}; typedef Point Vector; 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 a.x < b.x || (a.x == b.x && a.y < b.y);
} int dcmp(double x)
{
if(fabs(x) < eps) return ;
return x < ? - : ;
} 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;
} double Area(Point A, Point B, Point C)//三个点组成的三角形的面积
{
return Cross(B - A, C - A);
} Vector Rotate(Vector A, double rad) //向量A逆时针旋转rad弧度后的坐标
{
return Vector(A.x * cos(rad) - A.y * sin(rad), A.x * sin(rad) + A.y * cos(rad));
} 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 getD(Point A, Point B, Point C)
{
Vector v1 = C - B;
double a1 = Angle(A-B, v1);
v1 = Rotate(v1, a1/); Vector v2 = B - C;
double a2 = Angle(A-C, v2);
v2 = Rotate(v2, -a2/); return GetLineIntersection(B, v1, C, v2);
}
int main()
{
int T;
Point A, B, C, D, E, F;
scanf("%d",&T);
while(T--)
{
scanf("%lf%lf%lf%lf%lf%lf",&A.x, &A.y, &B.x, &B.y, &C.x, &C.y);
D = getD(A, B, C);
E = getD(B, C, A);
F = getD(C, A, B);
printf("%lf %lf %lf %lf %lf %lf\n", D.x, D.y, E.x, E.y, F.x, F.y);
}
return ;
}

uva 11178的更多相关文章

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

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

  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 向量旋转+求直线交点

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

  4. UVA 11178 - Morley's Theorem 向量

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

  5. UVA 11178 /// 向量旋转 两向量夹角

    题目大意: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_proble ...

  6. UVa 11178 (简单练习) Morley's Theorem

    题意: Morley定理:任意三角形中,每个角的三等分线,相交出来的三个点构成一个正三角形. 不过这和题目关系不大,题目所求是正三角形的三个点的坐标,保留6位小数. 分析: 由于对称性,求出D点,EF ...

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

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

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

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

  9. UVa 11178计算几何 模板题

    #include<cstdio> #include<cstring> #include<cmath> #include<iostream> #inclu ...

随机推荐

  1. win8系统中PL/SQL Developer连接Oracle出现的问题

    注意:所有软件最后不要安装在program files (x86)下  PL/SQL Developer显示Not logged on 以管理员的身份打开PL/SQL Developer 2.   t ...

  2. hadoop No FileSystem for scheme: hdfs

    http://stackoverflow.com/questions/17265002/hadoop-no-filesystem-for-scheme-file This is a typical c ...

  3. MetadataType的使用

    MetadataType的使用,MVC的Model层数据验证指定要与数据模型类关联的元数据类 using System.ComponentModel.DataAnnotations; //指定要与数据 ...

  4. Subset leetcode java

    题目: Given a set of distinct integers, S, return all possible subsets. Note: Elements in a subset mus ...

  5. Java读写Windows共享文件夹 .

    版权声明:本文为博主原创文章,未经博主允许不得转载. 项目常常需要有访问共享文件夹的需求,例如共享文件夹存储照片.文件等.那么如何使用Java读写Windows共享文件夹呢? Java可以使用JCIF ...

  6. 让JAVA代码跑得更快

    本文简单介绍一下在写代码过程中用到的一些让JAVA代码更高效的技巧. 1.   将一些系统资源放在池中(如数据库连接, 线程等) 在standalone的应用中, 数据库连接池可以使用一些开源的连接池 ...

  7. Unicode汉字编码表

    U+  0   1  2  3  4   5  6   7   8   9   A  B  C  D  E  F  ------------------------------------------ ...

  8. Android开发之技术文章索引

    Activity: 1.PreferenceActivity Fragment: 1.fragment中套用PagerSlidingTabStrip,切换底部时viewpager消失的解决 Widge ...

  9. c语言关键字总结

    1.关键字变更历史 1999年12月16日,ISO推出了C99标准,该标准新增了5个C语言关键字: inline restrict _Bool _Complex _Imaginary(注意bool 从 ...

  10. 【转】COCOS2D-X之CCHttpRequest下载图片Demo

    #include "pthread.h" #pragma comment(lib,"libcurl_imp.lib") #pragma comment(lib, ...