罗洛三角形面积?


这里我们将演示如何计算下方的罗洛三角形面积。罗洛三角形内部有一个等边三角形。假设其高度为 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.