首頁  >  文章  >  後端開發  >  最大的內接於橢圓內的正方形內的Reuleaux三角形是什麼?

最大的內接於橢圓內的正方形內的Reuleaux三角形是什麼?

WBOY
WBOY轉載
2023-08-29 20:49:051140瀏覽

在這裡,我們將看到一個最大的魯爾三角形的面積,該三角形內切於一個正方形,而該正方形則內切於一個橢圓。我們知道橢圓的長軸長度為2a,短軸長度為2b。正方形的邊長為'x',魯爾三角形的高度為h。

最大的內接於橢圓內的正方形內的Reuleaux三角形是什麼?

我們知道,內切於長軸為2a,短軸為2b的橢圓的正方形的邊長為−

最大的內接於橢圓內的正方形內的Reuleaux三角形是什麼?

魯爾三角形的高度與a相同。所以h = x。因此,魯爾三角形的面積為−

最大的內接於橢圓內的正方形內的Reuleaux三角形是什麼?

範例

#include <iostream>
#include <cmath>
using namespace std;
float areaReuleaux(float a, float b) { //a and b are half of major and minor axis of ellipse
   if (a < 0 || b < 0) //either a or b is negative it is invalid
      return -1;
   float x = sqrt((a*a) + (b*b)) / (a*b);
   float area = ((3.1415 - sqrt(3)) * (x) * (x))/2;
   return area;
}
int main() {
   float a = 5;
   float b = 4;
   cout << "Area of Reuleaux Triangle: " << areaReuleaux(a, b);
}

輸出

Area of Reuleaux Triangle: 0.0722343

以上是最大的內接於橢圓內的正方形內的Reuleaux三角形是什麼?的詳細內容。更多資訊請關注PHP中文網其他相關文章!

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