Given the vertices of a counter-clockwise triangle, compute the coordinates of its Brocard point rounded to five decimals.
Medium7GeometryMathNo attempts yetTime limit1sMemory limit256 MBThe Brocard point of a triangle ABC is the point P inside the triangle with ∠PAB=∠PBC=∠PCA. See the figure below.

The size the three angles share is called the Brocard angle. The Brocard angle is at most π/6, and that maximum occurs for an equilateral triangle. The Brocard point of an equilateral triangle is its centroid.
Given the coordinates of the three vertices, write a program that computes the coordinates of the Brocard point.
The first line contains the number of data sets P (1≤P≤10000). The data sets are independent and every one is processed the same way.
Each data set is a single line. The line begins with the data set number K, followed by the coordinates Ax, Ay, Bx, By, Cx, Cy of the three vertices, separated by spaces. K is an integer between 1 and P. Each coordinate is a real number whose absolute value is at most 1000.
The vertices are always given so that going from A to B, from B to C, and from C back to A circles the triangle counter-clockwise. The three points are never collinear.
Print one line for each data set. Print the data set number K, a space, the x coordinate of the Brocard point, a space, and the y coordinate of the Brocard point.
Round both coordinates to five decimal places. If a rounded coordinate is zero, print 0.00000 and never -0.00000.