Skip to content

Commit eb1c112

Browse files
Update Volume.java
1 parent 734a3f0 commit eb1c112

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,18 @@ public static double volumeFrustumOfCone(double r1, double r2, double height) {
103103
return (Math.PI * height / 3) * (r1 * r1 + r2 * r2 + r1 * r2);
104104
}
105105

106-
public static double volumeTriangularPrism(double base,double height,double length)
107-
{
108-
return 0.5*base*height*length;
109-
}
106+
/**
107+
* Calculate the volume of a triangular prism.
108+
*
109+
* @param base base of the triangle
110+
* @param height height of the triangle
111+
* @param length length of the prism
112+
* @return volume of the triangular prism
113+
*/
114+
public static double volumeTriangularPrism(double base, double height, double length) {
115+
return 0.5 * base * height * length;
116+
}
117+
110118

111119

112120
}

0 commit comments

Comments
 (0)