QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 256 MB Total points: 100

#5633. 三角形的布罗卡点

Statistics

三角形 $ABC$ 的布罗卡点(Brocard point)是一个位于三角形内部的点 $P$,满足: $\angle PAB = \angle PBC = \angle PCA$(见下图)。

这个公共角被称为布罗卡角(Brocard angle)。最大的布罗卡角为 $\pi/6$,它是等边三角形的布罗卡角(此时布罗卡点即为三角形的重心)。

编写一个程序,根据给定的三角形顶点坐标,计算其布罗卡点的坐标。

输入格式

输入的第一行包含一个整数 $P$($1 \le P \le 10000$),表示随后数据组的数量。每组数据应独立处理。

每组数据占一行,包含数据组编号 $K$,以及三角形顶点的六个坐标值 $Ax, Ay, Bx, By, Cx, Cy$(以空格分隔)。顶点按逆时针方向给出,即从 $A$ 到 $B$ 到 $C$ 再回到 $A$ 构成三角形。输入坐标为浮点数。

输出格式

对于每组数据,输出一行。输出行包含数据组编号 $K$,后跟一个空格,接着是布罗卡点的 $x$ 坐标,再后跟一个空格,最后是布罗卡点的 $y$ 坐标。坐标应保留五位小数。

样例

样例输入 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 1.40456 0.82890
2 1.56047 0.74902
3 3.87699 0.40167

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.