
在这里,我们将看到能够内切于等边三角形的最大正方形的面积。三角形的边长为'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.xuexi7.cn其它相关文章!