Equal Angles
Time limit1sMemory limit128 MB
For each triangle, compute the two Brocard points, where the angle a point makes with each side in cyclic order stays equal.
- Level
Medium7 of 10
- Topics
- Geometry, Math, Implementation
- Solved
- No attempts yet
Problem
The All-Equal company places towers on triangular plots so that the angles formed between a tower and the sides of its plot are all equal. For a triangle with vertices A, B, and C there are two such tower positions, call them P and Q:
- P is the point with .
- Q is the point with .
Given the triangle, find P and Q.

Input
The input contains several test cases. Each test case is a single line of six integers:
AX AY BX BY CX CY
Each integer is in the range to . They give the three vertices of the triangle: , , and . The points are guaranteed to form a triangle: they are distinct and not all collinear. The input ends with a line of six 0s.
Output
For each test case, output four space-separated real numbers:
PX PY QX QY
where and are the two requested points. Print each real number with exactly two decimal places (rounded), separated by single spaces. Print no blank lines between outputs.