Open In App

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

Last Updated : 07 Aug, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

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 = 5
Output: 28.3287

Input: a = 9
Output: 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;
}


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


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


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


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
?>


Javascript




<script>
 
// Javascript 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
    let h = 1.268 * a;
 
    // area of the reuleaux triangle
    let A = 0.70477 * Math.pow(h, 2);
 
    return A;
}
 
// Driver code
    let a = 5;
    document.write(Area(a) + "<br>");
 
// This code is contributed by Mayank Tyagi
 
</script>


Output: 

28.3287

 

Time complexity: O(1)

Auxiliary Space: O(1)



Similar Reads

Biggest Reuleaux Triangle inscribed within a square which is inscribed within an ellipse
Given an ellipse with major axis length and minor axis 2a &amp; 2b respectively 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 = 5, b = 4 Output: 0.0722389 Input: a = 7, b = 11 Output: 0.0202076 Approach: As, the side of the square insc
5 min read
Biggest Reuleaux Triangle within a Square which is inscribed within a Right angle Triangle
Given here is a right angle triangle with height l, base b &amp; hypotenuse h, 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: l = 5, b = 12, h = 13 Output: 8.77914 Input: l = 3, b = 4, h = 5 Output: 2.07116 Approach: We know, the side of
5 min read
Biggest Reuleaux Triangle inscribed within a Square inscribed in an equilateral triangle
Given here is an equilateral triangle of sidelength 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 = 5 Output : 3.79335 Input : a = 9 Output : 12.2905 Approach: We know that the side of the square inscribed within an equilateral tria
4 min read
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 Approach: From the figure, it is very clear that, if the side of the square is a, then a?2 = 2r a = ?2r
4 min read
Biggest Reuleaux Triangle inscribed within a square inscribed in a semicircle
Given here is a semicircle 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 : x = 5 Output : 14.0954 Input : x = 8 Output : 36.0842 Approach:We know, the side of the square inscribed within a semicircle is, a = 2r/?5. (Please ref
4 min read
Largest square that can be inscribed within a hexagon which is inscribed within an equilateral triangle
Given here is an equilateral triangle of side length a, which inscribes a hexagon which in turn inscribes a square. The task is to find the side length of the square.Examples: Input: a = 6 Output: 2.538 Input: a = 8 Output: 3.384 Approach: We know the, side length of a hexagon inscribed within an equilateral triangle is h = a/3. Please refer Larges
4 min read
Biggest Reuleaux Triangle within A Square
Given an integer a which is the side of a square, the task is to find the biggest Reuleaux Triangle that can be inscribed within it. Examples: Input: a = 6 Output: 25.3717 Input: a = 8 Output: 45.1053 Approach: We know that the Area of Reuleaux Triangle is 0.70477 * b2 where b is the distance between the parallel lines supporting the Reuleaux Trian
4 min read
Area of a square inscribed in a circle which is inscribed in a hexagon
Given a regular hexagon with side A, which inscribes a circle of radius r, which in turn inscribes a square of side a.The task is to find the area of this square.Examples: Input : A = 5 Output : 37.5 Input : A = 8 Output : 96 Approach: We know the radius of the circle inscribed within the hexagon is, r=A?3/2(Please refer here) Also, side length of
4 min read
Biggest Square that can be inscribed within an Equilateral triangle
Given here is an equilateral triangle of side length a. The task is to find the side of the biggest square that can be inscribed within it.Examples: Input: a = 5 Output: 2.32 Input: a = 7 Output: 3.248 Approach: Let the side of the square be x. Now, AH is perpendicular to DE. DE is parallel to BC, So, angle AED = angle ACB = 60 In triangle EFC, =
4 min read
Largest hexagon that can be inscribed within an equilateral triangle
Given an equilateral triangle of side length a, the task is to find the largest hexagon that can be inscribed within it.Examples: Input: a = 6 Output: 2Input: a = 9 Output: 3 Approach: From the figure, it is clear that the three small triangles are also equilateral. So they will have side length b = a / 3 where b is also the length of the hexagon a
3 min read