# Biggest Reuleaux Triangle within a Square which is inscribed within a Circle

Given here is a circle of radius r, which inscribes a square which in turn inscribes a reuleaux triangle. The task is to find the maximum possible area of this reuleaux triangle.

Examples:

```Input: r = 6
Output: 50.7434

Input: r = 11
Output: 170.554
```

## Recommended: Please try your approach on {IDE} first, before moving on to the solution.

Approach: From the figure, it is very clear that, if the side of the square is a, then

a√2 = 2r
a = √2r

Also, in reuleaux triangle, h = a = √2r, please refer Biggest Reuleaux Triangle within A Square.
So, Area of the Reuleaux Triangle is, A = 0.70477*h^2 = 0.70477*2*r^2

## C++

 `// C++ Program to find the biggest Reuleaux ` `// triangle inscribed within in a square which ` `// in turn is inscribed within a circle ` `#include ` `using` `namespace` `std; ` ` `  `// Function to find the Area ` `// of the Reuleaux triangle ` `float` `ReuleauxArea(``float` `r) ` `{ ` ` `  `    ``// radius cannot be negative ` `    ``if` `(r < 0) ` `        ``return` `-1; ` ` `  `    ``// Area of the Reuleaux triangle ` `    ``float` `A = 0.70477 * 2 * ``pow``(r, 2); ` ` `  `    ``return` `A; ` `} ` ` `  `// Driver code ` `int` `main() ` `{ ` `    ``float` `r = 6; ` `    ``cout << ReuleauxArea(r) << endl; ` `    ``return` `0; ` `} `

## Java

 `// Java Program to find the biggest Reuleaux ` `// triangle inscribed within in a square which ` `// in turn is inscribed within a circle ` `import` `java.util.*; ` ` `  `class` `GFG ` `{ ` ` `  `// Function to find the Area ` `// of the Reuleaux triangle ` `static` `double` `ReuleauxArea(``double` `r) ` `{ ` ` `  `    ``// radius cannot be negative ` `    ``if` `(r < ``0``) ` `        ``return` `-``1``; ` ` `  `    ``// Area of the Reuleaux triangle ` `    ``double` `A = ``0.70477` `* ``2` `* Math.pow(r, ``2``); ` ` `  `    ``return` `A; ` `} ` ` `  `// Driver code ` `public` `static` `void` `main(String args[]) ` `{ ` `    ``double` `r = ``6``; ` `    ``System.out.println(ReuleauxArea(r)); ` `     `  `} ` `} ` `// This code is contributed by ` `// Surendra_Gangwar `

## Python3

 `# Python3 Program to find the biggest  ` `# Reuleaux triangle inscribed within  ` `# in a square which in turn is inscribed ` `# within a circle ` `import` `math as mt ` ` `  `# Function to find the Area ` `# of the Reuleaux triangle ` `def` `ReuleauxArea(r): ` ` `  `    ``# radius cannot be negative ` `    ``if` `(r < ``0``): ` `        ``return` `-``1` ` `  `    ``# Area of the Reuleaux triangle ` `    ``A ``=` `0.70477` `*` `2` `*` `pow``(r, ``2``) ` ` `  `    ``return` `A ` ` `  `# Driver code ` `r ``=` `6` `print``(ReuleauxArea(r)) ` ` `  `# This code is contributed by  ` `# Mohit kumar 29 `

## C#

 `// C# Program to find the biggest Reuleaux ` `// triangle inscribed within in a square which ` `// in turn is inscribed within a circle ` `using` `System; ` ` `  `class` `GFG ` `{ ` ` `  `// Function to find the Area ` `// of the Reuleaux triangle ` `static` `double` `ReuleauxArea(``double` `r) ` `{ ` ` `  `    ``// radius cannot be negative ` `    ``if` `(r < 0) ` `        ``return` `-1; ` ` `  `    ``// Area of the Reuleaux triangle ` `    ``double` `A = 0.70477 * 2 * Math.Pow(r, 2); ` ` `  `    ``return` `A; ` `} ` ` `  `// Driver code ` `public` `static` `void` `Main() ` `{ ` `    ``double` `r = 6; ` `    ``Console.WriteLine(ReuleauxArea(r)); ` `} ` `} ` ` `  `// This code is contributed by ` `// shs.. `

## PHP

 ` `

Output:

```50.7434
```

My Personal Notes arrow_drop_up

Budding Web DeveloperKeen learnerAverage CoderDancer&Social Activist

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.

Article Tags :
Practice Tags :

Be the First to upvote.

Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.