3077Brocard Point of a Triangle

3077   Brocard Point of a Triangle

题目描述

The Brocard point of a triangle ABC is a point P in the triangle chosen so that: ∠PAB = ∠PBC = ∠PCA (see figure below).
 

 
The common angle is called the Brocard angle. The largest Brocard angle is π/6 which is the Brocard angle for an equilateral triangle (the Brocard point is the centroid of the triangle).
 
Write a program to compute the coordinates of the Brocard point of a triangle given the coordinates of the vertices.
 

输入格式:

The first line of input contains a single integer P, (1 <= P <= 10000), which is the number of data sets that follow.  Each data set should be processed identically and independently.
 
Each data set consists of a single line of input.  It contains the data set number, K, followed by the six space separated coordinate values Ax, Ay, Bx, By, Cx, Cy of the vertices of the triangle.  The vertices will always be specified so going from A to B to C and back to A circles the triangle counter-clockwise. Input coordinates are floating point values

输出格式:

For each data set there is a single line of output.  The single output line consists of the data set number, K, followed by a single space followed by the x coordinate of the Brocard point, followed by a single space followed by the y coordinate of the Brocard point.  Coordinates should be rounded to five decimal places.
输入样例 复制
3
1 0 -1.3 3.4 0.5 1.1 2.3
2 0 0 3 0 0 4
3 3.1 0.2 4.3 0.4 0 0.8
输出样例 复制
1 1.40456 0.82890
2 1.56047 0.74902
3 3.87699 0.40167

说明

2
2
通过提交
时空限制1000ms/128mb
题目来源
评测方式在线评测
题目类型
难        度