列表

详情


NC206957. BrocardPointofaTriangle

描述

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. 

示例1

输入:

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

原站题解

上次编辑到这里,代码来自缓存 点击恢复默认模板

上一题