In this Python program, we will learn how to find the area of an equilateral triangle.
In geometry, an equilateral triangle is a triangle in which all three sides are equal. In the familiar Euclidean geometry, an equilateral triangle is also equiangular; that is, all three internal angles are also congruent to each other and are each 60°.
Area of the Equilateral Triangle = (√3/ 4 ) x (side of equilateral triangle)²
Perimeter of the Equilateral Triangle = 3 x side of equilateral triangle
Semiperimeter of Equilateral Triangle = 3 x side of equilateral triangle / 2
Altitude of the Equilateral Triangle = (1/2) * √3 * side of equilateral triangle
Here is the source code of the program to calculate the area of the equilateral triangle.
# Python Program to Find the Area of an Equilateral Triangle
# Import Module
import math
# Take the Input From the User
side = float(input("Enter Length of any side of an Equilateral Triangle: "))
# calculate the area
Area = (math.sqrt(3)/ 4)*(side * side)
# calculate the Perimeter
Perimeter = 3 * side
# calculate the semi-perimeter
Semi = Perimeter / 2
# calculate the Altitude
Altitude = (math.sqrt(3)/2)* side
# Print the Output
print("\nArea of Equilateral Triangle = %.2f" %Area)
print("Perimeter of Equilateral Triangle = %.2f" %Perimeter)
print("Semi Perimeter of Equilateral Triangle = %.2f" %Semi)
print("Altitude of Equilateral Triangle = %.2f" %Altitude)
Enter Length of any side of an Equilateral Triangle: 5
Area of Equilateral Triangle = 10.83
Perimeter of Equilateral Triangle = 15.00
Semi Perimeter of Equilateral Triangle = 7.50
Altitude of Equilateral Triangle = 4.33
Comments