{"size": 1245, "ext": "js", "max_stars_repo_path": "figuras1.js", "max_stars_repo_name": "a4p3/cursoPracticoDeJavaScript", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "figuras1.js", "max_issues_repo_name": "a4p3/cursoPracticoDeJavaScript", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "figuras1.js", "max_forks_repo_name": "a4p3/cursoPracticoDeJavaScript", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 15.3703703704, "max_line_length": 59, "alphanum_fraction": 0.6955823293}
//Codigo del cuadrado
console.group("Cuadrados");



function perimetroCuadrado(lado) {
    return lado * 4;
}


function areaCuadrado(lado) {
    return lado * lado;
}

console.groupEnd();



//Codigo del triangulo
console.group("Triangulos");




function perimetroTriangulo(lado1, lado2,  base) {
return lado1 +  lado2  + base;
}


function areaTriangulo(base,  altura) {
return  (base * altura)  /  2;
}


console.groupEnd();



//Codigo del circulo
console.group("Circulos");

//Diametro
function diametroCirculo(radio){
return radio * 2;
}

// PI
 const PI =  Math.PI;
 console.log(" PI es:  "  + PI + "cm " )

//Circunferencia
function  perimetroCirculo(radio){
const  diametro  = diametroCirculo(radio);
return diametro *  PI;
}

//Área

function areaCirculo(radio)  {
return  (radio * radio) * PI;
}

console.groupEnd();

//Aqui interactuamos con el html
function calcularPerimetroCuadrado()  {
 const input = document.getElementById("inputCuadrado");
 const  value = input.value;

 const perimetro = perimetroCuadrado(value);
 alert(perimetro);
}

function calcularAreaCuadrado() {
    const input = document.getElementById("inputCuadrado");
    const  value = input.value;
   
    const area = areaCuadrado(value);
    alert(area);
}
