# PKU 1673 EXOCENTER OF A TRIANGLE 三角形的垂心

396人阅读 评论(0)

EXOCENTER OF A TRIANGLE

Description

Given a triangle ABC, the Extriangles of ABC are constructed as follows:

On each side of ABC, construct a square (ABDE, BCHJ and ACFG in the figure below).

ABC的每边，构建一个正方形（ABDEBCHJACFG）；
Connect adjacent square corners to form the three Extriangles (AGD, BEJ and CFH in the figure).

The Exomedians of ABC are the medians of the Extriangles, which pass through vertices of the original triangle,extended into the original triangle (LAO, MBO and NCO in the figure. As the figure indicates, the three Exomedians intersect at a common point called the Exocenter (point O in the figure).

This problem is to write a program to compute the Exocenters of triangles.

Input

The first line of the input consists of a positive integer n, which is the number of datasets that follow. Each dataset consists of 3 lines; each line contains two floating point values which represent the (two -dimensional) coordinate of one vertex of a triangle. So, there are total of (n*3) + 1 lines of input. Note: All input triangles wi ll be strongly non-degenerate in that no vertex will be within one unit of the line through the other two vertices.

Output

For each dataset you must print out the coordinates of the Exocenter of the input triangle correct to four decimal places.

Sample Input

2

0.0 0.0

9.0 12.0

14.0 0.0

3.0 4.0

13.0 19.0

2.0 -10.0

Sample Output

9.0000 3.7500

-48.0400 23.3600

1、  直接模拟，求LAMB的交点，即为O点。

a、  保证ABC按逆时针方向；

b、  求个边的正方形的顶点。

c、  求交点。

d、  注意：向量ab按不同的方向，可以求出两个满足ab垂直acab=acc点。模拟过程中需要特别注意。

2、  另外有人证明O点是ABC的垂心。

关于垂心的证明

By--ysl

Aa0），Bb0），C0c），Fx1,y1），Hx2,y2

|BC|=|CH|     b2 +c2=x22+(y2-c)2

BCCH                y2-c=x2*b/c  代入上式

x22=c2   同理x21=c2

（如果有错，请大家指出来）

0
0

* 以上用户言论只代表其个人观点，不代表CSDN网站的观点或立场
个人资料
• 访问：6789次
• 积分：168
• 等级：
• 排名：千里之外
• 原创：11篇
• 转载：0篇
• 译文：0篇
• 评论：0条
文章存档
阅读排行