在这里,我们将看到一个正方形的面积内接于一个圆,并且该圆内接于一个等边三角形。正方形的边是“a”。圆的半径为“r”,六边形的边为“a”。图表如下所示。

我们知道等边三角形的内接圆的半径就是三角形的内半径。所以值为 -

所以正方形的对角线是 -

所以正方形的面积是 -

示例
#include#include using namespace std; float area(float A) { //A is the side of the triangle if (A < 0) //if the value is negative it is invalid return -1; float d = A / sqrt(3); float area = 0.5*d*d; return area; } int main() { float side = 10; cout << "Area is: " << area(side); }
输出
Area is: 16.6667










