一個正六邊形內接正方形,一個正方形內接最大的勒洛三角形?
在這裡,我們將看到一個正六邊形內接正方形、正方形內部接最大的勒洛三角形的面積。假設六邊形的邊長為“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
廣告
資料結構
網路
關係資料庫管理系統
作業系統
Java
iOS
HTML
CSS
Android
Python
C 程式設計
C++
C#
MongoDB
MySQL
Javascript
PHP