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

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

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

• 本文已收录于以下专栏：

## poj 1673 EXOCENTER OF A TRIANGLE（求三角形垂心）

EXOCENTER OF A TRIANGLE Time Limit: 1000MS   Memory Limit: 10000K Total Submissions:...
• fp_hzq
• 2012年09月15日 16:42
• 753

## poj 1673(EXOCENTER OF A TRIANGLE) (垂心证明）

poj 1673(EXOCENTER OF A TRIANGLE)  (垂心证明） http://poj.org/problem?id=1673       题目简单描述： ...

## POJ1673-EXOCENTER OF A TRIANGLE

EXOCENTER OF A TRIANGLE Time Limit: 1000MS   Memory Limit: 10000K Total Submissions:...

## POJ 1673 EXOCENTER OF A TRIANGLE

• lj94093
• 2015年02月27日 23:18
• 389

## POJ 1673 三角形垂心

EXOCENTER OF A TRIANGLE Time Limit: 1000MS   Memory Limit: 10000K Total Submissions:...

## Pku1163 the Triangle （动态规划） 数字三角形

H - The Triangle Time Limit:1000MS     Memory Limit:10000KB     64bit IO Format:%I64d & %I64u ...

## 使用Matlab计算两条线的交点及三角形垂心

• 2017年03月28日 10:36
• 3KB
• 下载

举报原因： 您举报文章：PKU 1673 EXOCENTER OF A TRIANGLE 三角形的垂心 色情 政治 抄袭 广告 招聘 骂人 其他 (最多只允许输入30个字)