407101: GYM102697 072 Tri-Angle

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

072. Tri-Angletime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Given the three points that represent the corners of an isosceles triangle, determine the angle that the triangle is pointing. The angle can be calculated based on the vector created along the line of symmetry of the triangle that exits through the point of the triangle. The angle should be represented in degrees and should be determined relative to the vector (1,0). The following image shows a triangle with points at (-1,0), (0,1), and (-2,2), and has an angle of 135 degrees.

To add to the difficulty, the order of the points is not predetermined, so you will need to determine which points fall away from and on the line of symmetry. Your answer should always be positive, between 0 and 360, and should be represented in degree form. Remember you can convert from radians to degrees with the formula $$$deg=rad*\frac{180}{π}$$$Input

Each line contains two space-separated floating point values that represent the $$$x$$$ and $$$y$$$ values of each point of the triangle. They are randomly ordered.

Output

A single floating point value that represents the degree measure of the angle created from the positive x-axis to the direction of the triangle.

ExampleInput
-2 2
0 1
-1 0
Output
135.0
Note

Make sure answers are provided in degrees and fall within the range of 0 to 360.

加入题单

上一题 下一题 算法标签: