在这里,我们将看到一个最大的鲁尔三角形的面积,该三角形内切于一个正方形,而该正方形则内切于一个椭圆。我们知道椭圆的长轴长度为2a,短轴长度为2b。正方形的边长为'x',鲁尔三角形的高度为h。

我们知道,内切于长轴为2a,短轴为2b的椭圆的正方形的边长为−

鲁尔三角形的高度与a相同。所以h = x。因此,鲁尔三角形的面积为−
。
示例
#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 <h2>输出</h2>
<pre class="brush:php;toolbar:false;">Area of Reuleaux Triangle: 0.0722343











