diff --git a/index.html b/index.html index 02db980..bf8a9fe 100644 --- a/index.html +++ b/index.html @@ -165,6 +165,9 @@

cot

+ diff --git a/script.js b/script.js index 584f990..7a6ac8d 100644 --- a/script.js +++ b/script.js @@ -49,6 +49,7 @@ Array.prototype.forEach.call(buttons, function (button) { trimmedButtonValue != "sec" && trimmedButtonValue != "cosec" && trimmedButtonValue != "cot" && + trimmedButtonValue != "arccot" && trimmedButtonValue != "\u221B" ) { display.value += trimmedButtonValue; @@ -109,6 +110,9 @@ Array.prototype.forEach.call(buttons, function (button) { else if (trimmedButtonValue === "cot"){ calculatecot(); } + else if (trimmedButtonValue === "arccot"){ + calculatearccot(); + } else if (trimmedButtonValue === "\u221B"){ calculatecuberoot(); @@ -283,6 +287,9 @@ function calculatecosec() { function calculatecot() { display.value=Math.cos((Math.PI/180)*display.value)/Math.sin((Math.PI/180)*display.value); } +function calculatearccot() { + display.value = (Math.PI/2 - Math.atan(display.value)); +} //cuberoot function function calculatecuberoot(){ console.log('cuberoot');