21018_EXOCENTEROFATRIANGLE

2022-5-16 18:18| 发布者: Hocassian| 查看: 41| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-3-89504758783400-Problem List-采集的数据-后羿采集器.html

Pro.ID

21018

Title

EXOCENTER OF A TRIANGLE

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=21018

AC

3

Submit

9

Ratio

33.33%

时间&空间限制

  • Time Limit: 1000/500 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    Given a triangle ABC, the Extriangles of ABC are constructed as follows:

    On each side of ABC, construct a square (ABDE, BCHJ and ACFG in the figure below).

    Connect adjacent square corners to form the three Extriangles (AGD, BEJ and CFH in the figure).

    The Exomedians of ABC are the medians of the Extriangles, which pass through vertices of the original triangle,extended into the original triangle (LAO, MBO and NCO in the figure. As the figure indicates, the three Exomedians intersect at a common point called the Exocenter (point O in the figure).

    This problem is to write a program to compute the Exocenters of triangles.

    输入

    The first line of the input consists of a positive integer n, which is the number of datasets that follow. Each dataset consists of 3 lines; each line contains two floating point values which represent the (two -dimensional) coordinate of one vertex of a triangle. So, there are total of (n×3) + 1 lines of input.

    Note: All input triangles wi ll be strongly non-degenerate in that no vertex will be within one unit of the line through the other two vertices.

    输出

    Description

    Given a triangle ABC, the Extriangles of ABC are constructed as follows:

    On each side of ABC, construct a square (ABDE, BCHJ and ACFG in the figure below).

    Connect adjacent square corners to form the three Extriangles (AGD, BEJ and CFH in the figure).

    The Exomedians of ABC are the medians of the Extriangles, which pass through vertices of the original triangle,extended into the original triangle (LAO, MBO and NCO in the figure. As the figure indicates, the three Exomedians intersect at a common point called the Exocenter (point O in the figure).

    This problem is to write a program to compute the Exocenters of triangles.

    Input

    The first line of the input consists of a positive integer n, which is the number of datasets that follow. Each dataset consists of 3 lines; each line contains two floating point values which represent the (two -dimensional) coordinate of one vertex of a triangle. So, there are total of (n×3) + 1 lines of input.

    Note: All input triangles wi ll be strongly non-degenerate in that no vertex will be within one unit of the line through the other two vertices.

    Output

    For each dataset you must print out the coordinates of the Exocenter of the input triangle correct to four decimal places.

    Sample Input

    2
    0.0 0.0
    9.0 12.0
    14.0 0.0
    3.0 4.0
    13.0 19.0
    2.0 -10.0

    Sample Output

    9.0000 3.7500
    -48.0400 23.3600

    Source

    样例输入

    2
    0.0 0.0
    9.0 12.0
    14.0 0.0
    3.0 4.0
    13.0 19.0
    2.0 -10.0

    样例输出

    9.0000 3.7500
    -48.0400 23.3600

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部