可以在等边三角形内切入的面积最大的正方形?
在这里,我们将了解能在等边三角形内切入的面积最大的正方形。三角形的一边是“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
广告
数据结构
网络
关系型数据库管理系统
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP