Skip to content
Related Articles
Open in App
Not now

Related Articles

Python Program for Program to calculate area of a Tetrahedron

Improve Article
Save Article
  • Difficulty Level : Basic
  • Last Updated : 14 Aug, 2022
Improve Article
Save Article

A Tetrahedron is simply a pyramid with a triangular base. It is a solid object with four triangular faces, three on the sides or lateral faces, one on the bottom or the base and four vertices or corners. If the faces are all congruent equilateral triangles, then the tetrahedron is called regular. The volume of the tetrahedron can be found by using the following formula :

Volume = a3/(6√2)

Examples :

Input : side = 3
Output : 3.18


Input : side = 20
Output : 942.81

Python3




# Python code to find the volume of a tetrahedron
import math
def vol_tetra(side):
    volume = (side ** 3 / (6 * math.sqrt(2)))
    return round(volume, 2)
 
# Driver Code
side = 3
vol = vol_tetra(side)
print(vol)

Output :

3.18

Time complexity: O(1) since no loop is used the algorithm takes up constant time to perform the operations

Auxiliary Space: O(1)  since no extra array is used so the space taken by the algorithm is constant

Please refer complete article on Program to calculate area of a Tetrahedron for more details!

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!