Skip to content

Commit 734a3f0

Browse files
Adding Triangular Prism
1 parent 24f4090 commit 734a3f0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/main/java/com/thealgorithms/maths/Volume.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,11 @@ public static double volumePyramid(double baseArea, double height) {
102102
public static double volumeFrustumOfCone(double r1, double r2, double height) {
103103
return (Math.PI * height / 3) * (r1 * r1 + r2 * r2 + r1 * r2);
104104
}
105+
106+
public static double volumeTriangularPrism(double base,double height,double length)
107+
{
108+
return 0.5*base*height*length;
109+
}
110+
111+
105112
}

0 commit comments

Comments
 (0)