
- C++ Basics
- C++ Home
- C++ Overview
- C++ Environment Setup
- C++ Basic Syntax
- C++ Comments
- C++ Data Types
- C++ Variable Types
- C++ Variable Scope
- C++ Constants/Literals
- C++ Modifier Types
- C++ Storage Classes
- C++ Operators
- C++ Loop Types
- C++ Decision Making
- C++ Functions
- C++ Numbers
- C++ Arrays
- C++ Strings
- C++ Pointers
- C++ References
- C++ Date & Time
- C++ Basic Input/Output
- C++ Data Structures
- C++ Object Oriented
- C++ Classes & Objects
- C++ Inheritance
- C++ Overloading
- C++ Polymorphism
- C++ Abstraction
- C++ Encapsulation
- C++ Interfaces
Program to find the Circumcircle of any regular polygon in C++
In this problem, we are given two numbers that give the number of sides of a polygon N and the length of each side A. Our task is to create a Program to find the Circumcircle of any regular polygon in C++.
Problem description − Here, we need to find the radius and area of the circumcircle of the regular polygon whose side number and length are given.
Let’s take an example to understand the problem,
Input
n = 4 a = 2
Program to illustrate the working of our solution,
Example
#include <bits/stdc++.h> using namespace std; void CalcRadAreaCircumcircle(float n, float a) { float r = a / sqrt( 2 * ( 1 - cos(360 / n))); cout<<"The radius of Circumcircle is "<<r<<endl; cout<<"The area of circumcircle is "<<((3.14)*r*r); } int main() { float n = 5, a = 6; CalcRadAreaCircumcircle(n, a); return 0; }
Output
The radius of Circumcircle is 3.02487 The area of circumcircle is 28.7305
- Related Articles
- C++ program to find the Area of the circumcircle of any triangles with sides given?
- Program to find the Interior and Exterior Angle of a Regular Polygon in C++
- Area of the circumcircle of any triangles with sides given in C++
- Area of largest Circle inscribed in N-sided Regular polygon in C Program?
- Area of largest Circle inscribe in N-sided Regular polygon in C Program?
- Determine the position of the third person on regular N sided polygon in C++ Program
- Area of a n-sided regular polygon with given Radius in C Program?
- Apothem of a n-sided regular polygon in C++
- The interior angle of a regular polygon is $156$ . Find the number of sides of the polygon.
- Program to calculate area of Circumcircle of an Equilateral Triangle in C++
- Area of Circumcircle of a Right Angled Triangle in C Program?
- Program to count number of isosceles triangle from colored vertex regular polygon in Python
- Each interior angle of a regular polygon is four times the exterior angle. Find the number of sides in the polygon.
- Determine the position of the third person on regular N sided polygon in C++?
- What is regular polygon ?

Advertisements