At the center of the origin, give a point on the circle, ask for another two points on the circle, make the distance and maximum of these three points, it is easy to think that this is a equilateral triangle
And then there are these two formulas point A for the known point
A*b=|a|*|b|*cos (120);
X*x+y*y=r*r;
Sample Input
2
1.500 2.000
563.585 1.251
Sample Output
0.982-2.299-2.482 0.299
-280.709-488.704-282.876 487.453
1# include <iostream>2# include <cstdio>3# include <cstring>4# include <algorithm>5# include <cmath>6# include <queue>7# define LLLong Long8 using namespacestd;9 Ten One intMain () A { - //freopen ("In.txt", "R", stdin); - intT; thescanf"%d", &T); - while(t--) - { - Doublex, y, x1, y1, x2, Y2, A, B, C, R; +scanf"%LF%LF", &x, &y); -R = sqrt (x*x + y*y); +A = R *R; AB = R * R *y; atc = (r*r*r*r-4*X*X*R*R)/4.0 ; -Y1 = (-1.0*B-SQRT (B*b-4*A*C))/(2*a); -y2 = (-1.0*b + sqrt (b*b-4*A*C))/(2*a); - if(Fabs (x0) < 1e-7) - { -X1 =-SQRT (r*r-y1*y1); inx2 = sqrt (r*r-y2*y2); - } to Else + { -X1 = (-r*r/2-Y*Y1)/x; thex2 = (-r*r/2-Y*Y2)/x; * } $printf"%.3lf%.3lf%.3lf%.3lf\n", x1, y1, x2, y2);Panax Notoginseng - } the + return 0 ; A}View Code
HDU 1700 (round inner triangle to maximum perimeter)