一個正六邊形內接正方形,一個正方形內接最大的勒洛三角形?


在這裡,我們將看到一個正六邊形內接正方形、正方形內部接最大的勒洛三角形的面積。假設六邊形的邊長為“a”。正方形的邊長為 x,勒洛三角形的高度為 h。

從一個六邊形內接正方形的每條邊的公式中 –

𝑥 = 1.268𝑎

勒洛三角形的高度與 x 相同。所以 x = h。勒洛三角形的面積為 –

示例

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

輸出

Area of Reuleaux Triangle: 28.3268

更新於: 2019 年 8 月 1 日

67 次瀏覽

開啟您的 職業

完成課程以獲得認證

立即開始
廣告