羅洛三角形面積?


這裡我們將演示如何計算下方的羅洛三角形面積。羅洛三角形內部有一個等邊三角形。假設其高度為 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

更新於: 2019 年 8 月 1 日

291 次檢視

開啟你的職業生涯

透過完成學習獲得認證

獲取開始
廣告
© . All rights reserved.