Area of circle which is inscribed in equilateral triangle

• Last Updated : 16 Mar, 2021

Given here is an equilateral triangle with side length a, the task is to find the area of the circle inscribed in that equilateral triangle.
Examples:

Input : a = 4
Output : 4.1887902047863905

Input : a = 10
Output : 26.1799387799 Approach:

Area of equilateral triangle =

*** QuickLaTeX cannot compile formula:

*** Error message:
Error: Nothing to show, formula is empty

Semi perimeter of equilateral triangle = (a + a + a) / 2
Radius of inscribed circle r = Area of equilateral triangle / Semi perimeter of equilateral triangle
=

*** QuickLaTeX cannot compile formula:

*** Error message:
Error: Nothing to show, formula is empty

=

*** QuickLaTeX cannot compile formula:

*** Error message:
Error: Nothing to show, formula is empty

Area of circle = PI*(r*r) =

*** QuickLaTeX cannot compile formula:

*** Error message:
Error: Nothing to show, formula is empty

Below is the implementation of above approach:

C++

 // C++ program to find the area// of circle which is inscribed// in equilateral triangle# include# define PI 3.14using namespace std; // Function return the area of circle// inscribed in equilateral trianglefloat circle_inscribed(int a){    return PI * (a * a) / 12;} // Driver codeint main(){    int a = 4;     cout << circle_inscribed(a);    return 0;} // This code is contributed// by Mahadev99

Java

 // Java program to find the area// of circle which is inscribed// in equilateral triangleimport java.io.*; class GFG{ static double PI = 3.14; // Function return the area of circle// inscribed in equilateral trianglestatic double circle_inscribed(int a){    return PI * (a * a) / 12;} // Driver codepublic static void main (String[] args){    int a = 4;     System.out.println(circle_inscribed(a));}} // This code is contributed by anuj_67

Python3

 # Python3 program to find the area of circle# which is inscribed in equilateral triangle # import math library for pi valuefrom math import pi # Function return the area of circle# inscribed in equilateral triangledef circle_inscribed(a):    return pi*(a * a) / 12 # Driver codea = 4print(circle_inscribed(a))

C#

 // C# program to find the area// of circle which is inscribed// in equilateral triangleusing System; class GFG{static double PI = 3.14; // Function return the area of circle// inscribed in equilateral trianglestatic double circle_inscribed(int a){    return PI * (a * a) / 12;} // Driver codepublic static void Main (){    int a = 4;     Console.WriteLine( circle_inscribed(a));}} // This code is contributed// by inder_verma



Javascript



Output:

4.1887902047863905

My Personal Notes arrow_drop_up