# Biggest Reuleaux Triangle inscribed within a square which is inscribed within a hexagon

Given a regular hexagon of side length **a** 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:a = 5Output:28.3287Input:a = 9Output:91.7848

**Approach**: As the side of the square inscribed within a hexagon is **x = 1.268a**. Please refer Largest Square that can be inscribed within a hexagon.

Also, in the reuleaux triangle, **h = x = 1.268a**.

So, Area of the reuleaux triangle, **A = 0.70477*h^2 = 0.70477*(1.268a)^2**.

Below is the implementation of the above approach:

## C++

`// C++ Program to find the biggest Reuleaux triangle ` `// inscribed within in a square which in turn ` `// is inscribed within a hexagon ` `#include <bits/stdc++.h> ` `using` `namespace` `std; ` ` ` `// Function to find the biggest reuleaux triangle ` `float` `Area(` `float` `a) ` `{ ` ` ` ` ` `// side cannot be negative ` ` ` `if` `(a < 0) ` ` ` `return` `-1; ` ` ` ` ` `// height of the reuleaux triangle ` ` ` `float` `h = 1.268 * a; ` ` ` ` ` `// area of the reuleaux triangle ` ` ` `float` `A = 0.70477 * ` `pow` `(h, 2); ` ` ` ` ` `return` `A; ` `} ` ` ` `// Driver code ` `int` `main() ` `{ ` ` ` `float` `a = 5; ` ` ` `cout << Area(a) << endl; ` ` ` ` ` `return` `0; ` `} ` |

*chevron_right*

*filter_none*

## Java

`// Java Program to find the biggest Reuleaux triangle ` `// inscribed within in a square which in turn ` `// is inscribed within a hexagon ` ` ` `import` `java.io.*; ` ` ` `class` `GFG ` `{ ` ` ` `// Function to find the biggest reuleaux triangle ` `static` `float` `Area(` `float` `a) ` `{ ` ` ` ` ` `// side cannot be negative ` ` ` `if` `(a < ` `0` `) ` ` ` `return` `-` `1` `; ` ` ` ` ` `// height of the reuleaux triangle ` ` ` `float` `h =(` `float` `) ` `1.268` `* a; ` ` ` ` ` `// area of the reuleaux triangle ` ` ` `float` `A = (` `float` `)(` `0.70477` `* Math.pow(h, ` `2` `)); ` ` ` ` ` `return` `A; ` `} ` ` ` ` ` `// Driver code ` ` ` `public` `static` `void` `main (String[] args) ` ` ` `{ ` ` ` `float` `a = ` `5` `; ` ` ` `System.out.println( Area(a)); ` ` ` `} ` `} ` ` ` `// This code is contributed by anuj_67 ` |

*chevron_right*

*filter_none*

## Python3

`# Python3 Program to find the biggest ` `# Reuleaux triangle inscribed within ` `# in a square which in turn is ` `# inscribed within a hexagon ` `import` `math ` ` ` `# Function to find the biggest ` `# reuleaux triangle ` `def` `Area(a): ` ` ` ` ` `# side cannot be negative ` ` ` `if` `(a < ` `0` `): ` ` ` `return` `-` `1` ` ` ` ` `# height of the reuleaux triangle ` ` ` `h ` `=` `1.268` `*` `a ` ` ` ` ` `# area of the reuleaux triangle ` ` ` `A ` `=` `0.70477` `*` `math.` `pow` `(h, ` `2` `) ` ` ` ` ` `return` `A ` ` ` `# Driver code ` `a ` `=` `5` `print` `(Area(a),end ` `=` `"\n"` `) ` ` ` `# This code is contributed ` `# by Akanksha Rai ` |

*chevron_right*

*filter_none*

## C#

`// C# Program to find the biggest Reuleaux ` `// triangle inscribed within in a square ` `// which in turn is inscribed within a hexagon ` `using` `System; ` ` ` `class` `GFG ` `{ ` ` ` `// Function to find the biggest reuleaux triangle ` `static` `float` `Area(` `float` `a) ` `{ ` ` ` ` ` `// side cannot be negative ` ` ` `if` `(a < 0) ` ` ` `return` `-1; ` ` ` ` ` `// height of the reuleaux triangle ` ` ` `float` `h =(` `float` `) 1.268 * a; ` ` ` ` ` `// area of the reuleaux triangle ` ` ` `float` `A = (` `float` `)(0.70477 * Math.Pow(h, 2)); ` ` ` ` ` `return` `A; ` `} ` ` ` `// Driver code ` `public` `static` `void` `Main () ` `{ ` ` ` `float` `a = 5; ` ` ` `Console.WriteLine(Area(a)); ` `} ` `} ` ` ` `// This code is contributed ` `// by Akanksha Rai ` |

*chevron_right*

*filter_none*

## PHP

`<?php ` `// PHP Program to find the biggest Reuleaux ` `// triangle inscribed within in a square ` `// which in turn is inscribed within a hexagon ` ` ` `// Function to find the biggest ` `// reuleaux triangle ` `function` `Area(` `$a` `) ` `{ ` ` ` ` ` `// side cannot be negative ` ` ` `if` `(` `$a` `< 0) ` ` ` `return` `-1; ` ` ` ` ` `// height of the reuleaux triangle ` ` ` `$h` `= 1.268 * ` `$a` `; ` ` ` ` ` `// area of the reuleaux triangle ` ` ` `$A` `= 0.70477 * pow(` `$h` `, 2); ` ` ` ` ` `return` `$A` `; ` `} ` ` ` `// Driver code ` `$a` `= 5; ` `echo` `round` `(Area(` `$a` `), 4); ` ` ` `// This code is contributed by Ryuga ` `?> ` |

*chevron_right*

*filter_none*

**Output:**

28.3287

## Recommended Posts:

- Biggest Reuleaux Triangle inscribed within a square which is inscribed within an ellipse
- Biggest Reuleaux Triangle inscribed within a Square inscribed in an equilateral triangle
- Biggest Reuleaux Triangle within a Square which is inscribed within a Circle
- Biggest Reuleaux Triangle inscirbed within a square inscribed in a semicircle
- Biggest Reuleaux Triangle within a Square which is inscribed within a Right angle Triangle
- Largest square that can be inscribed within a hexagon which is inscribed within an equilateral triangle
- Biggest Square that can be inscribed within an Equilateral triangle
- Area of a square inscribed in a circle which is inscribed in a hexagon
- Area of a square inscribed in a circle which is inscribed in an equilateral triangle
- Biggest Reuleaux Triangle within A Square
- Area of the Largest Triangle inscribed in a Hexagon
- Largest hexagon that can be inscribed within an equilateral triangle
- Largest Square that can be inscribed within a hexagon
- Largest hexagon that can be inscribed within a square
- Radius of the biggest possible circle inscribed in rhombus which in turn is inscribed in a rectangle

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.