- C Programming Tutorial
- C - Home
- C - Overview
- C - Environment Setup
- C - Program Structure
- C - Basic Syntax
- C - Data Types
- C - Variables
- C - Constants
- C - Storage Classes
- C - Operators
- C - Decision Making
- C - Loops
- C - Functions
- C - Scope Rules
- C - Arrays
- C - Pointers
- C - Strings
- C - Structures
- C - Unions
- C - Bit Fields
- C - Typedef
- C - Input & Output
- C - File I/O
- C - Preprocessors
- C - Header Files
- C - Type Casting
- C - Error Handling
- C - Recursion
- C - Variable Arguments
- C - Memory Management
- C - Command Line Arguments
- C Programming useful Resources
- C - Questions & Answers
- C - Quick Guide
- C - Useful Resources
- C - Discussion

# Area of largest Circle inscribed in N-sided Regular polygon in C Program?

An n-sided regular polygon inscribed in a circle, the radius of this circle is given by the formula,

r = a/(2*tan(180/n))

Suppose a polygon have 6 faces i.e., a hexagon and as we know mathematically that the angle is 30 degree

So the radius of circle will be (a / (2*tan(30)))

Therefore, r = a√3/2

We see the polygon can be divided into N equal triangles. Looking into one of the triangles, we see that the whole angle at the center can be divided into = 360/N

So, angle x = 180/n Now, tan(x) = (a / 2) * r So, r = a / ( 2 * tan(x)) So, Area of the Inscribed Circle is, A = Πr2 = Π * (a / (2 * tan(x))) * (a / (2*tan(x)))

## Example

#include <iostream> using namespace std; int main() { float area; float n = 6; float a = 4; float r = a / (2 * tan((180 / n) * 3.14159 / 180)); area = (3.14) * (r) * (r); cout <<”area = ”<<area<< endl; return 0; }

## Output

area = 37.6801

- Related Articles
- Area of largest Circle inscribe in N-sided Regular polygon in C Program?
- Area of a n-sided regular polygon with given Radius in C Program?
- Area of a n-sided regular polygon with given side length in C++
- Apothem of a n-sided regular polygon in C++
- Area of a n-sided regular polygon with given Radius?
- Find the area of largest circle inscribed in ellipse in C++
- Determine the position of the third person on regular N sided polygon in C++ Program
- Area of a circle inscribed in a regular hexagon?
- Determine the position of the third person on regular N sided polygon in C++?
- Area of circle inscribed within rhombus in C Program?
- Area of decagon inscribed within the circle in C Program?
- Area of circle which is inscribed in equilateral triangle in C Program?
- Find number of diagonals in n sided convex polygon in C++
- Area of a square inscribed in a circle which is inscribed in a hexagon in C Program?
- C Program for area of decagon inscribed within the circle?

Advertisements