here we will see the area of a square which in inscribed in one circle and that circle is inscribed in a hexagon. the side of the square is ‘a’. the radius of the circle is ‘r’, and the side of the hexagon is ‘a’. the diagram will be like below.

We know that the radius of a circle inscribed in a hexagon is −

Also the radius of the circle is half of the diagonal of the square. So −

Then we can say −

Then the area will be −

#include <iostream>
#include <cmath>
using namespace std;
float area(float A) { //A is the side of the hexagon
if (A < 0) //if the value is negative it is invalid
return -1;
float area = (A*A) * float(3.0/2.0);
return area;
}
int main() {
float side = 5;
cout << "Area is: " << area(side);
}Area is: 37.5
以上就是在C程序中,将以下内容翻译为中文:正六边形内切的圆中内切的正方形的面积是多少?的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号