在這里,我們將看到能夠內切于等邊三角形的最大正方形的面積。三角形的邊長為’a’,正方形的邊長為x。
三角形的邊長’a’為?
所以x為?
例子
#include <iostream>
#include <cmath>
using namespace std;
float areaSquare(float a) { //a is side of triangle
if (a < 0 ) //if a is negative, then this is invalid
return -1;
float area = a / (1 + 2/sqrt(3));
return area;
}
int main() {
float a = 7;
cout << "Area of Rectangle: " << areaSquare(a);
}
登錄后復制
輸出
Area of Rectangle: 3.24871
登錄后復制
以上就是可以在等邊三角形內切的最大正方形是多大?的詳細內容,更多請關注www.xfxf.net其它相關文章!






