Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Selected Reading
Program to calculate area of Enneagon
An enneagon (also known as nonagon) is a polygon with 9 sides. To calculate the area of an enneagon, we use a specific mathematical formula based on the side length.
Syntax
Area = (a² × 9) / (4 × tan(20°)) Area ? 6.1818 × a²
Where a is the length of each side of the enneagon.
Example
The following program calculates the area of an enneagon using the mathematical formula −
#include <stdio.h>
#include <math.h>
int main() {
float side = 6.0;
float area;
float multiplier = 6.1818;
printf("Program to find area of Enneagon
");
printf("The side of the Enneagon is %.1f
", side);
area = multiplier * side * side;
printf("The area of Enneagon is %.2f
", area);
return 0;
}
Program to find area of Enneagon The side of the Enneagon is 6.0 The area of Enneagon is 222.65
Key Points
- The multiplier 6.1818 is derived from the formula
(9) / (4 × tan(20°)) - The angle 20° comes from dividing 180° by 9 (the number of sides)
- This formula works for any regular enneagon where all sides are equal
Conclusion
Calculating the area of an enneagon is straightforward using the formula 6.1818 × a². This approach provides accurate results for any regular nine-sided polygon.
Advertisements
