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 −
example#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程序中,将以下内容翻译为中文:正六边形内切的圆中内切的正方形的面积是多少?的详细内容。