Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

简单公式

Posted by Liuzhaoliang at 2014-08-27 07:32:28 on Problem 2546 and last updated at 2014-08-27 07:33:00
对于非相离非相含的情况

设圆心连线段h与圆交点连线段v相交于O.
我们知道h是v的中垂线。
左边圆圆心O1右边圆圆心O2.
O1在O左边a, O2在O右边b
v的一半长度为c

a*a+c*c = r1*r1
b*b+c*c = r2*r2

a+b = dist (h的长度)

这个很容易求出a,b 注意,可能出现负值,但是这个负值是有意义的。
然后求夹角。
        double d = dist(x1-x2,y1-y2);
        double t1 = d, t2 = (r1*r1-r2*r2)/d;
        double a = (t1+t2)/2, b = (t1-t2)/2;
        double alpha = acos(a/r1), beta = acos(b/r2);
        double area = alpha*r1*r1 - r1*r1*sin(alpha)*cos(alpha) + beta*r2*r2 - r2*r2*sin(beta)*cos(beta);

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator