Skip to content

Adding Triangular Prism #6453

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/main/java/com/thealgorithms/maths/Volume.java
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please fix the failing build and clang format worklfow @DEVANSH-GAJJAR

Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,19 @@ public static double volumePyramid(double baseArea, double height) {
public static double volumeFrustumOfCone(double r1, double r2, double height) {
return (Math.PI * height / 3) * (r1 * r1 + r2 * r2 + r1 * r2);
}

/**
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is not indented correctly (compare with other methods)

* Calculate the volume of a triangular prism.
*
* @param base base of the triangle
* @param height height of the triangle
* @param length length of the prism
* @return volume of the triangular prism
*/
public static double volumeTriangularPrism(double base, double height, double length) {
return 0.5 * base * height * length;
}



}
Loading