From 80e29290f963d2daf5c17ab9cafd2a2d0da0c6ec Mon Sep 17 00:00:00 2001 From: Sajith Minrutha <66878264+SajithMinrutha@users.noreply.github.com> Date: Sat, 7 Oct 2023 07:27:28 +0530 Subject: [PATCH] Create XgxUIi.js Signed-off-by: Sajith Minrutha <66878264+SajithMinrutha@users.noreply.github.com> --- j8Jgw3/XgxUIi.js | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 j8Jgw3/XgxUIi.js diff --git a/j8Jgw3/XgxUIi.js b/j8Jgw3/XgxUIi.js new file mode 100644 index 0000000..7672e33 --- /dev/null +++ b/j8Jgw3/XgxUIi.js @@ -0,0 +1,9 @@ +// Function to calculate the area of an equilateral triangle +function equilateralTriangleArea(sideLength) { + return (sideLength * sideLength * Math.sqrt(3)) / 4; +} + +// Example usage: +const sideLength = 5; // Replace with your desired side length +const area = equilateralTriangleArea(sideLength); +console.log(`The area of the equilateral triangle is ${area}`);