From 7943196475d7e71e2da3496365281dab96f3435c Mon Sep 17 00:00:00 2001 From: Anshul Kansal <114342859+anshulkansal04@users.noreply.github.com> Date: Tue, 3 Oct 2023 14:54:42 +0530 Subject: [PATCH] Create VyyiNT.go Signed-off-by: Anshul Kansal <114342859+anshulkansal04@users.noreply.github.com> --- CpvbdH/VyyiNT.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 CpvbdH/VyyiNT.go diff --git a/CpvbdH/VyyiNT.go b/CpvbdH/VyyiNT.go new file mode 100644 index 00000000..d4136b40 --- /dev/null +++ b/CpvbdH/VyyiNT.go @@ -0,0 +1,14 @@ +package main + +import ( + "math" +) + +func hpVolume(slength, height float64) float64 { + // Calculating the area of hexagon's base + basearea := 3 * math.Sqrt(3) * math.Pow(slength, 2) / 2 + // Calculating the volume of prism using formula, + // V = basearea * height + volume := basearea * height + return volume +}