羅洛三角形面積?
這裡我們將演示如何計算下方的羅洛三角形面積。羅洛三角形內部有一個等邊三角形。假設其高度為 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
廣告
資料結構
網路
RDBMS
作業系統
Java
iOS
HTML
CSS
Android
Python
C 程式設計
C++
C#
MongoDB
MySQL
Javascript
PHP