Triangle to Hexagon
Time limit2sMemory limit512 MB
Given triangle coordinates, find where the angle bisectors meet the circumcircle, intersect those lines with the sides, and print six segment lengths.
- Level
Medium7 of 10
- Topics
- Geometry, Math, Implementation, Brute force
- Solved
- No attempts yet
Problem
Let be the incenter of triangle and let be its circumscribed circle. The lines , and meet the circle a second time at , and respectively.

Let and be the points where the line meets the sides and . In the same way, let and be the points where the line meets and , and let and be the points where the line meets and .
Read the coordinates of the vertices , and , then print the lengths of the segments , , , , and . The inequality is known to hold, so you can use it to check your own numbers.
Do the computation in double precision floating point.
Input
The first line contains one integer , the number of data sets (). Every data set is processed the same way and independently of the others.
Each data set is a single line. The line holds the data set number followed by three floating point values separated by spaces: the coordinate of , , the coordinate of , , and the coordinate of , . is always the origin and always lies on the axis, so .
is an integer, , and . The three points are never collinear.
Output
Print one line per data set. The line holds the data set number , then the lengths of , , , , and in that order, each rounded to 4 decimal places and separated by a single space.