# Find area of Icosahedron

The problem involves calculating the surface area of an icosahedron given the length of its side. An icosahedron is a three-dimensional polyhedron with 20 equilateral triangle faces. Calculating the surface area of an icosahedron is a geometric computation used in fields such as geometry, engineering, and computer graphics.

## Problem Statement

Given the length of a side of an icosahedron, we need to calculate and output the surface area of the icosahedron. The side length is provided as input, and we are required to use the formula for the surface area of an icosahedron to find the area.

## Icosahedron Visualization

Imagine a three-dimensional shape with 20 equilateral triangle faces. Each vertex is connected to five other vertices. Here's a simplified 2D representation of an icosahedron:

``````
/\
/\/\
/\/\/\
/\/\/\/\
/\/\/\/\/\
/\/\/\/\/\/\
/\/\/\/\/\/\/\
/\/\/\/\/\/\/\/\
/\/\/\/\/\/\/\/\/\``````

## Idea to Solve

To solve this problem, we can follow these steps:

1. Calculate the surface area of the icosahedron using the formula: `5 * √3 * side * side`.
2. Use the provided value for the side length to compute the surface area.

## Pseudocode

``````function icosahedron_area(side):
area = 5 * sqrt(3) * (side * side)
return area

for each test case:
side = icosahedron side length
result = icosahedron_area(side)
print("Icosahedron [ Side :", side, "]")
print("Area :", result)``````

## Algorithm Explanation

1. For each test case, calculate the surface area of the icosahedron using the provided formula.
2. Print the icosahedron's side length and the calculated surface area.

## Code Solution

``````//C Program
//Find area of Icosahedron
#include <stdio.h>

#include <math.h>
//Calculate area of Icosahedron by given side
void icosahedron_area(double side)
{
//Calculate Formula
//5√3*(size*size)
double area = 5 * sqrt(3) * (side * side);
//Display the result of icosahedron area
printf(" Icosahedron  [ Side : %lf ] ", side);
printf("\n Area : %lf\n\n", area);
}
int main()
{
//Test Cases
icosahedron_area(4);
icosahedron_area(8);
icosahedron_area(13.6);
return 0;
}``````

#### Output

`````` Icosahedron  [ Side : 4.000000 ]
Area : 138.564065

Icosahedron  [ Side : 8.000000 ]
Area : 554.256258

Icosahedron  [ Side : 13.600000 ]
Area : 1601.800587
``````
``````// Java Program
// Find area of Icosahedron
class IcosahedronArea
{
//Calculate area of Icosahedron by given side
public void icosahedron_area(double side)
{
//Calculate Formula
//5√3*(side²)
double area = 5 * Math.sqrt(3) * (side * side);
//Display the result of icosahedron area
System.out.print(" Icosahedron [ Side : " + side + " ] ");
System.out.print("\n Area : " + area + "\n\n");
}
public static void main(String[] args)
{
IcosahedronArea obj = new IcosahedronArea();
//Test Cases
obj.icosahedron_area(4);
obj.icosahedron_area(8);
obj.icosahedron_area(13.6);
}
}``````

#### Output

`````` Icosahedron [ Side : 4.0 ]
Area : 138.56406460551017

Icosahedron [ Side : 8.0 ]
Area : 554.2562584220407

Icosahedron [ Side : 13.6 ]
Area : 1601.8005868396974
``````
``````// C# Program
// Find area of Icosahedron
using System;
class IcosahedronArea
{
//Calculate area of Icosahedron by given side
public void icosahedron_area(double side)
{
//Calculate Formula
//5√3*(side²)
double area = 5 * Math.Sqrt(3) * (side * side);
Console.Write(" Icosahedron [ Side : " + side + " ] ");
Console.Write("\n Area : " + area + "\n\n");
}
public static void Main(String[] args)
{
IcosahedronArea obj = new IcosahedronArea();
//Test Cases
obj.icosahedron_area(4);
obj.icosahedron_area(8);
obj.icosahedron_area(13.6);
}
}``````

#### Output

`````` Icosahedron [ Side : 4 ]
Area : 138.56406460551

Icosahedron [ Side : 8 ]
Area : 554.256258422041

Icosahedron [ Side : 13.6 ]
Area : 1601.8005868397
``````
``````// C++ Program
// Find area of Icosahedron
#include<iostream>
#include <math.h>
using namespace std;
class IcosahedronArea
{
public:
//Calculate area of Icosahedron by given side
void icosahedron_area(double side)
{
//Calculate Formula
//5√3*(side²)
double area = 5 * sqrt(3) *(side *side);
cout << " Icosahedron [ Side : " << side << " ] ";
cout << "\n Area : " << area << "\n\n";
}
};
int main()
{
IcosahedronArea obj =  IcosahedronArea();
//Test Cases
obj.icosahedron_area(4);
obj.icosahedron_area(8);
obj.icosahedron_area(13.6);
return 0;
}``````

#### Output

`````` Icosahedron [ Side : 4 ]
Area : 138.564

Icosahedron [ Side : 8 ]
Area : 554.256

Icosahedron [ Side : 13.6 ]
Area : 1601.8
``````
``````<?php
// Php Program
// Find area of Icosahedron
class IcosahedronArea
{
//Calculate area of Icosahedron by given side
public 	function icosahedron_area(\$side)
{
//Calculate Formula
//5√3*(side²)
\$area = 5 * sqrt(3) *(\$side *\$side);
//Display the result of icosahedron area
echo(" Icosahedron [ Side : ". \$side ." ] ");
echo("\n Area : ". \$area ."\n\n");
}
}

function main()
{
\$obj = new IcosahedronArea();
//Test Cases
\$obj->icosahedron_area(4);
\$obj->icosahedron_area(8);
\$obj->icosahedron_area(13.6);
}
main();``````

#### Output

`````` Icosahedron [ Side : 4 ]
Area : 138.56406460551

Icosahedron [ Side : 8 ]
Area : 554.25625842204

Icosahedron [ Side : 13.6 ]
Area : 1601.8005868397
``````
``````// Node Js Program
// Find area of Icosahedron
class IcosahedronArea
{
//Calculate area of Icosahedron by given side
icosahedron_area(side)
{
//Calculate Formula
//5√3*(side²)
var area = 5 * Math.sqrt(3) *(side *side);
//Display the result of icosahedron area
process.stdout.write(" Icosahedron [ Side : " + side + " ] ");
process.stdout.write("\n Area : " + area + "\n\n");
}
}

function main(args)
{
var obj = new IcosahedronArea();
//Test Cases
obj.icosahedron_area(4);
obj.icosahedron_area(8);
obj.icosahedron_area(13.6);
}
main();``````

#### Output

`````` Icosahedron [ Side : 4 ]
Area : 138.56406460551017

Icosahedron [ Side : 8 ]
Area : 554.2562584220407

Icosahedron [ Side : 13.6 ]
Area : 1601.8005868396974
``````
``````#  Python 3 Program
#  Find area of Icosahedron
import math
class IcosahedronArea :
# Calculate area of Icosahedron by given side
def icosahedron_area(self, side) :
# Calculate Formula
# 5√3*(side²)
area = 5 * math.sqrt(3) * (side * side)
# Display the result of icosahedron area
print(" Icosahedron [ Side : ", side ," ] ", end = "")
print("\n Area : ", area ,"\n\n", end = "")

def main() :
obj = IcosahedronArea()
# Test Cases
obj.icosahedron_area(4)
obj.icosahedron_area(8)
obj.icosahedron_area(13.6)

if __name__ == "__main__": main()``````

#### Output

`````` Icosahedron [ Side :  4  ]
Area :  138.56406460551017

Icosahedron [ Side :  8  ]
Area :  554.2562584220407

Icosahedron [ Side :  13.6  ]
Area :  1601.8005868396974
``````
``````#  Ruby Program
#  Find area of Icosahedron
class IcosahedronArea

# Calculate area of Icosahedron by given side
def icosahedron_area(side)

# Calculate Formula
# 5√3*(side²)
area = 5 * Math.sqrt(3) * (side * side)
# Display the result of icosahedron area
print(" Icosahedron [ Side  :", side ," ] ")
print("\n Area  :", area ,"\n\n")
end
end
def main()

obj = IcosahedronArea.new()
# Test Cases
obj.icosahedron_area(4)
obj.icosahedron_area(8)
obj.icosahedron_area(13.6)
end
main()``````

#### Output

`````` Icosahedron [ Side  :4 ]
Area  :138.56406460551017

Icosahedron [ Side  :8 ]
Area  :554.2562584220407

Icosahedron [ Side  :13.6 ]
Area  :1601.8005868396974

``````
``````// Scala Program
// Find area of Icosahedron
class IcosahedronArea
{
//Calculate area of Icosahedron by given side
def icosahedron_area(side: Double): Unit = {
//Calculate Formula
//5√3*(side²)
var area: Double = 5 * Math.sqrt(3) * (side * side);
//Display the result of icosahedron area
print(" Icosahedron [ Side : " + side + " ] ");
print("\n Area : " + area + "\n\n");
}
}
object Main
{
def main(args: Array[String]): Unit = {
var obj: IcosahedronArea = new IcosahedronArea();
//Test Cases
obj.icosahedron_area(4);
obj.icosahedron_area(8);
obj.icosahedron_area(13.6);
}
}``````

#### Output

`````` Icosahedron [ Side : 4.0 ]
Area : 138.56406460551017

Icosahedron [ Side : 8.0 ]
Area : 554.2562584220407

Icosahedron [ Side : 13.6 ]
Area : 1601.8005868396974
``````
``````// Swift Program
// Find area of Icosahedron
import Foundation
class IcosahedronArea
{
//Calculate area of Icosahedron by given side
func icosahedron_area(_ side: Double)
{
//Calculate Formula
//5√3*(side²)
let area: Double = 5 * sqrt(3) * (side * side);
//Display the result of icosahedron area
print(" Icosahedron [ Side : ", side ," ] ", terminator: "");
print("\n Area : ", area ,"\n\n", terminator: "");
}
}
func main()
{
let obj: IcosahedronArea = IcosahedronArea();
//Test Cases
obj.icosahedron_area(4);
obj.icosahedron_area(8);
obj.icosahedron_area(13.6);
}
main();``````

#### Output

`````` Icosahedron [ Side :  4.0  ]
Area :  138.56406460551

Icosahedron [ Side :  8.0  ]
Area :  554.256258422041

Icosahedron [ Side :  13.6  ]
Area :  1601.8005868397
``````

## Output Explanation

The provided code runs three test cases and calculates the surface areas of icosahedrons with different side lengths. The output includes the icosahedron's side length and the corresponding calculated surface areas.

## Time Complexity

The time complexity of this code is O(1) for each test case. The calculations involve basic arithmetic operations and a square root computation, which take constant time. Therefore, the overall time complexity remains constant for each test case.

## Comment

Please share your knowledge to improve code and content standard. Also submit your doubts, and test case. We improve by your feedback. We will try to resolve your query as soon as possible.