1 point
center(double x1
, double y1
, double x2
, double y2
, double x3
, double y3
){
7 double C1
= (A1
*(x1
+x2
) + B1
*(y1
+y2
))/2;
8 double C2
= (A2
*(x2
+x3
) + B2
*(y2
+y3
))/2;
9 double d
= A1
*B2
-A2
*B1
;
10 if(fabs(d
)<1e-7)return p
;
11 double y
= (A1
*C2
-A2
*C1
)/d
;
12 double x
= -(B1
*C2
-B2
*C1
)/d
;