Un triángulo equilátero es un triángulo en el que los tres lados y los ángulos son iguales. Los tres ángulos internos del triángulo equilátero miden 60 grados.
- Si conocemos la longitud de cada lado del triángulo equilátero, entonces podemos usar la fórmula mencionada a continuación para calcular el área del triángulo equilátero.
Area of Equilateral Triangle = (sqrt(3)/4) * a * a
- Si conocemos la longitud de la altura del triángulo equilátero junto con la longitud del lado, entonces podemos usar la fórmula mencionada a continuación para calcular su área.
Area of Equilateral Triangle = (1/2) x Side x Altitude
Perímetro del Triángulo Equilátero:
Perimeter of Equilateral Triangle : 3 X a
¿Cómo funciona la fórmula del área?
Echemos un vistazo al siguiente diagrama. Sabemos que el área de un triángulo es 1/2 * base * altura. El valor de h es sqrt(a 2 – (a/2) 2 ) = sqrt(3) * a / 2. Entonces el área se convierte en 1/2 * a * (sqrt(3) * a / 2) = (sqrt (3)/4) * un * un
Ejemplos:
Input : side = 4 Output : Area of Equilateral Triangle: 6.9282 Perimeter of Equilateral Triangle: 12 Input : side = 12 Output : Area of Equilateral Triangle: 62.3538 Perimeter of Equilateral Triangle: 36
C++
// CPP program to find area // and perimeter of equilateral triangle #include <bits/stdc++.h> using namespace std; // Function to calculate Area // of equilateral triangle float area_equi_triangle(float side) { return sqrt(3) / 4 * side * side; } // Function to calculate Perimeter // of equilateral triangle float peri_equi_triangle(float side) { return 3 * side; } // Driver Code int main() { float side = 4; cout << "Area of Equilateral Triangle: " << area_equi_triangle(side) << endl; cout << "Perimeter of Equilateral Triangle: " << peri_equi_triangle(side); return 0; }
Java
// Java Program to find area and // perimeter of equilateral triangle import java.io.*; class GFG { // Function to calculate // Area of equilateral triangle static float area_equi_triangle(float side) { return (float)(((Math.sqrt(3)) / 4) * side * side); } // Function to calculate // Perimeter of equilateral // triangle static float peri_equi_triangle(float side) { return 3 * side; } // Driver Code public static void main(String arg[]) { float side = 4; System.out.print("Area of Equilateral Triangle:"); System.out.println(area_equi_triangle(side)); System.out.print("Perimeter of Equilateral Triangle:"); System.out.println(peri_equi_triangle(side)); } } // This code is contributed // by Anant Agarwal.
Python
# Python3 program to calculate Area and # Perimeter of equilateral Triangle # Importing Math library for sqrt from math import * # Function to calculate Area # of equilateral triangle def area_equilateral( side ): area = (sqrt(3) / 4) * side * side print ("Area of Equilateral Triangle: % f"% area) # Function to calculate Perimeter # of equilateral triangle def perimeter( side ): perimeter = 3 * side print ("Perimeter of Equilateral Triangle: % f"% perimeter) # Driver code side = 4 area_equilateral( side ) perimeter( side )
C#
// C# Program to find area and // perimeter of equilateral triangle using System; class GFG { // Function to calculate // Area of equilateral triangle static float area_equi_triangle(float side) { return (float)(((Math.Sqrt(3)) / 4) * side * side); } // Function to calculate // Perimeter of equilateral // triangle static float peri_equi_triangle(float side) { return 3 * side; } // Driver Code public static void Main() { float side = 4; Console.Write("Area of Equilateral Triangle:"); Console.WriteLine(area_equi_triangle(side)); Console.Write("Perimeter of Equilateral Triangle:"); Console.WriteLine(peri_equi_triangle(side)); } } // This code is contributed // by vt_m.
PHP
<?php // PHP program to find area // and perimeter of equilateral triangle // Function to calculate Area // of equilateral triangle function area_equi_triangle( $side) { return sqrt(3) / 4 * $side * $side; } // Function to calculate Perimeter // of equilateral triangle function peri_equi_triangle( $side) { return 3 * $side; } // Driver Code $side = 4; echo("Area of Equilateral Triangle: "); echo(area_equi_triangle($side)); echo("\n"); echo("Perimeter of Equilateral Triangle: "); echo( peri_equi_triangle($side)); // This code is contributed // by vt_m. ?>
Javascript
<script> //Javascript program to find area // and perimeter of equilateral triangle // Function to calculate // Area of equilateral triangle function area_equi_triangle(side) { return (((Math.sqrt(3)) / 4) * side * side).toFixed(4); } // Function to calculate // Perimeter of equilateral // triangle function peri_equi_triangle(side) { return 3 * side; } //Driver code var side = 4; document.write("Area of Equilateral Triangle:"); document.write(area_equi_triangle(side)+"\n"); document.write("Perimeter of Equilateral Triangle:"); document.write(peri_equi_triangle(side)+"\n"); //This code is contributed by shruti456rawal </script>
Producción
Area of Equilateral Triangle: 6.9282 Perimeter of Equilateral Triangle: 12
Complejidad de tiempo: O (logn)
Espacio Auxiliar: O(1)
Publicación traducida automáticamente
Artículo escrito por shreyanshi_arun y traducido por Barcelona Geeks. The original can be accessed here. Licence: CCBY-SA