首頁  >  文章  >  後端開發  >  盧埃爾三角形的面積是多少?

盧埃爾三角形的面積是多少?

WBOY
WBOY轉載
2023-09-03 08:45:091036瀏覽

在這裡,我們將看到如何計算如下的Reuleaux三角形的面積。 Reuleaux三角形內部有一個等邊三角形。假設其高度為h,這個形狀是由三個圓的交集所組成的。

盧埃爾三角形的面積是多少?

有三個圓形磁區。每個扇區的面積為−

盧埃爾三角形的面積是多少?

由於等邊三角形的面積被加了三次,所以我們必須減去它們。因此最終的面積為−

盧埃爾三角形的面積是多少?

範例

#include <iostream>
#include <cmath>
using namespace std;
float areaReuleaux(float h) {
   if (h < 0) //if h is negative it is invalid
   return -1;
   float area = ((3.1415 - sqrt(3)) * h * h)/2;
   return area;
}
int main() {
   float height = 6;
   cout << "Area of Reuleaux Triangle: " << areaReuleaux(height);
}

#輸出

Area of Reuleaux Triangle: 25.3701

以上是盧埃爾三角形的面積是多少?的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文轉載於:tutorialspoint.com。如有侵權,請聯絡admin@php.cn刪除