A regular decagon is a decagon with all sides and angles equal. Here we need to use the radius r of the circle to find the area of the decagon inscribed in the circle,
The mathematical formula for the side of the decagon inscribed in the circle,
a = r√(2-2cos36<sup>o</sup>)
(using the cosine rule )
The formula for finding the area of a decagon,
Area = 5*a<sup>2</sup>*(√5+2√5)/2 Area = 5 *(r√(2-2cos36))^<sup>2</sup>*(√5+2√5)/2 Area = (5r<sup>2</sup>*(3-√5)*(√5+2√5))/4
Use this formula in the program,
#include <stdio.h> #include <math.h> int main() { float r = 8; float area = (5 * pow(r, 2) * (3 - sqrt(5))* (sqrt(5) + (2 * sqrt(5))))/ 4; printf("area = %f",area); return 0; }
area = 409.968933
The above is the detailed content of In a C program, translate the following into Chinese: What is the area of a decagon depicted in a circle?. For more information, please follow other related articles on the PHP Chinese website!