# Area of square Circumscribed by Circle

Given the radius(r) of circle then find the area of square which is Circumscribed by circle.

Examples:

Input : r = 3 Output :Area of square = 18 Input :r = 6 Output :Area of square = 72

All four sides of a square are of equal length and all four angles are 90 degree. The circle is circumscribed on a given square shown by a shaded region in the below diagram.

**Properties of Circumscribed circle are as follows:**

- The center of the circumcircle is the point where the two diagonals of a square meet.
- Circumscribed circle of a square is made through the four vertices of a square.
- The radius of a circumcircle of a square is equal to the radius of a square.

Formula used to calculate the area of circumscribed square is:

2 * r^{2}

where, r is the radius of the circle in which a square is circumscribed by circle.

How does this formula work?Assume diagonal of square is d and length of side is a.

We know from the Pythagoras Theorem, the diagonal of a

square is √(2) times the length of a side.

i.e d^{2}= a^{2}+ a^{2}

d = 2 * a^{2}

d = √(2) * a

Now,

a = d / √2and We know diagonal of square that are Circumscribed by

Circle is equal to Diameter of circle.

so Area of square = a * a

= d / √(2) * d / √(2)

= d^{2}/ 2

= ( 2 * r )^{2}/ 2 ( We know d = 2 * r )

=2 * r^{2}

## CPP

`// C++ program to find Area of ` `// square Circumscribed by Circle ` `#include <iostream> ` `using` `namespace` `std; ` ` ` `// Function to find area of square ` `int` `find_Area(` `int` `r) ` `{ ` ` ` `return` `(2 * r * r); ` `} ` ` ` `// Driver code ` `int` `main() ` `{ ` ` ` `// Radius of a circle ` ` ` `int` `r = 3; ` ` ` ` ` `// Call Function to find ` ` ` `// an area of square ` ` ` `cout << ` `" Area of square = "` ` ` `<< find_Area(r); ` ` ` ` ` `return` `0; ` `} ` |

*chevron_right*

*filter_none*

## Java

`// Java program to find Area of ` `// square Circumscribed by Circle ` `class` `GFG { ` ` ` ` ` `// Function to find area of square ` ` ` `static` `int` `find_Area(` `int` `r) ` ` ` `{ ` ` ` `return` `(` `2` `* r * r); ` ` ` `} ` ` ` ` ` `// Driver code ` ` ` `public` `static` `void` `main(String[] args) ` ` ` `{ ` ` ` `// Radius of a circle ` ` ` `int` `r = ` `3` `; ` ` ` ` ` `// Call Function to find ` ` ` `// an area of square ` ` ` `System.out.print(` `" Area of square = "` ` ` `+ find_Area(r)); ` ` ` `} ` `} ` ` ` `// This code is contributed by Anant Agarwal. ` |

*chevron_right*

*filter_none*

## Python3

`# Python program to ` `# find Area of ` `# square Circumscribed ` `# by Circle ` ` ` `# Function to find ` `# area of square ` `def` `find_Area(r): ` ` ` ` ` `return` `(` `2` `*` `r ` `*` `r) ` ` ` `# driver code ` `# Radius of a circle ` `r ` `=` `3` ` ` `# Call Function to find ` `# an area of square ` `print` `(` `" Area of square = "` `, find_Area(r)) ` ` ` `# This code is contributed ` `# by Anant Agarwal. ` |

*chevron_right*

*filter_none*

## C#

`// C# program to find Area of ` `// square Circumscribed by Circle ` `using` `System; ` ` ` `class` `GFG { ` ` ` ` ` `// Function to find area of square ` ` ` `static` `int` `find_Area(` `int` `r) ` ` ` `{ ` ` ` `return` `(2 * r * r); ` ` ` `} ` ` ` ` ` `// Driver code ` ` ` `public` `static` `void` `Main() ` ` ` `{ ` ` ` `// Radius of a circle ` ` ` `int` `r = 3; ` ` ` ` ` `// Call Function to find ` ` ` `// an area of square ` ` ` `Console.WriteLine(` `" Area of square = "` ` ` `+ find_Area(r)); ` ` ` `} ` `} ` ` ` `// This code is contributed by vt_m. ` |

*chevron_right*

*filter_none*

## PHP

`<?php ` `// PHP program to find Area of ` `// square Circumscribed by Circle ` ` ` `// Function to find area of square ` `function` `find_Area( ` `$r` `) ` `{ ` ` ` `return` `(2 * ` `$r` `* ` `$r` `); ` `} ` ` ` ` ` `// Driver code ` ` ` `// Radius of a circle ` ` ` `$r` `= 3; ` ` ` ` ` `// Call Function to find ` ` ` `// an area of square ` ` ` `echo` `(` `"Area of square = "` `); ` ` ` `echo` `(find_Area(` `$r` `)); ` ` ` `// This code is contributed by vt_m. ` `?> ` |

*chevron_right*

*filter_none*

Output:

Area of square = 18

**Time Complexity: O(1)**

Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: **DSA Self Paced**. Become industry ready at a student-friendly price.

## Recommended Posts:

- Area of a Circumscribed Circle of a Square
- Area of the circle that has a square and a circle inscribed in it
- Program to calculate area of an Circle inscribed in a Square
- Find area of the larger circle when radius of the smaller circle and difference in the area is given
- Side of a regular n-sided polygon circumscribed in a circle
- Area of a square inscribed in a circle which is inscribed in an equilateral triangle
- Program to calculate area of inner circle which passes through center of outer circle and touches its circumference
- Area of circle inscribed within rhombus
- Program to find area of a circle
- Area of decagon inscribed within the circle
- Area of largest Circle that can be inscribed in a SemiCircle
- Area of a circle inscribed in a regular hexagon
- Given equation of a circle as string, find area
- Area of circle inscribed in a Isosceles Trapezoid
- Area of circle which is inscribed in equilateral triangle
- Find the area of largest circle inscribed in ellipse
- Area of Equilateral triangle inscribed in a Circle of radius R
- Area of largest Circle inscribe in N-sided Regular polygon
- Program for Area Of Square
- Biggest Reuleaux Triangle within a Square which is inscribed within a Circle

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.