兩圓相交求相交面積

2021-08-07 12:56:56 字數 660 閱讀 9636

1.海**式

2.余弦公式cosa=…

public double areaofintersectionofcircles(int firstx,int firsty,int firstr,int secondx,int secondy,int secondr)

alpha=math.acos((d*d+firstr*firstr-secondr*secondr)/(2

*d*firstr));//餘弦定理取得相交弧所對本圓的圓心角

area=alpha*firstr

*firstr;//本圓扇形面積

alpha=math.acos((d*d+secondr*secondr-firstr*firstr)/(2

*d*secondr));//餘弦定理取得相交弧所對另一圓的圓心角

area+=alpha*secondr

*secondr;//另一圓的扇形面積

double s=(d+firstr+secondr)/2;//海**式之s

area-=math.sqrt(s

*(s-d)*(

s-firstr)*(

s-secondr))*2;//兩扇形面積減去兩三角形面積即為交集

return area;

}

求兩圓是否相交

呃.貌似 是很簡單 今天課間休息 照了張相片用q發給爸爸了 另作上傳頭像用 這個實訓第五天了 從第一天helloworld 講到遞迴 呵呵 慢慢來 剛好複習 我們也要求每天寫日誌 我突然想起csdn 也來寫寫 只是隨便寫寫 別砸我 沒人看就算了 有人看就算了 先每天都寫了好多個 隨便來乙個 類cir...

模版 兩圓相交部分面積

題目 poj 2546 circular area 題意 計算兩圓公共部分面積 260k 0ms g 提交wa,c 提交ac o o include include include include include include using namespace std const double ep...

HDU 3264 求兩圓相交的面積

此題意很簡單,思路也容易想到。但是我就是卡在了求兩圓相交求面積的地方。還好現在有了模板了。不說了,直接貼 還得多多總結,二分真的很好用,要學會用啊!include include include includeusing namespace std define inf 2147483647 def...