最大罗洛三角形内接正方形,正方形内接椭圆?
这里我们将看到内接正方形内接椭圆的最大罗洛三角形的面积,该正方形内接在椭圆内。我们知道长轴长度是 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 < 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
广告
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP