题目链接:HDU 1700
Problem Description
There is a cycle with its center on the origin.
Now give you a point on the cycle, you are to find out the other two points on it, to maximize the sum of the distance between each other
you may assume that the radius of the cycle will not exceed 1000.
Input
There are T test cases, in each case there are 2 decimal number representing the coordinate of the given point.
Output
For each testcase you are supposed to output the coordinates of both of the unknow points by 3 decimal places of precision
Alway output the lower one first(with a smaller Y-coordinate value), if they have the same Y value output the one with a smaller X.
NOTE
when output, if the absolute difference between the coordinate values X1 and X2 is smaller than 0.0005, we assume they are equal.
Sample Input
1 | 2 |
Sample Output
1 | 0.982 -2.299 -2.482 0.299 |
Source
Solution
题意
给定一个圆形在原点的圆和一个圆上的点,在圆上另外找两个点使得三个点组成的三角形周长最大。
思路
坐标旋转
坐标旋转模板题。
三角形是等边三角形是周长最大。
让给定的点绕原点旋转 $120\degree$ 和 $240\degree$ 即可。
Code
1 |
|