TheAlgorithms / Java

All Algorithms implemented in Java
MIT License
60.11k stars 19.4k forks source link

Add Volume "Algorithm Frustum Of Cone" Then Test It. #5479

Closed ahmedelazab1220 closed 1 month ago

ahmedelazab1220 commented 1 month ago

Hey I've implemented FrustumOfCone Algorithm in src/main/java/com.thealgorithms/maths/Volume.java with the test class in the test package

for enhancement https://github.com/TheAlgorithms/Java/issues/5478

Algorithm Overview:

  1. Input Parameters: The method accepts three parameters:

    • r1: radius of the top circular base
    • r2: radius of the bottom circular base
    • height: height of the frustum
  2. Volume Calculation: The method calculates the volume using the defined formula and returns the computed value as a double.

  3. Unit Testing: Comprehensive unit tests have been implemented to validate the correctness of the calculation. The tests cover various scenarios to ensure that the function behaves as expected.

Performance:

codecov-commenter commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 52.29%. Comparing base (1e8abf1) to head (3834126). Report is 212 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #5479 +/- ## ========================================= Coverage 52.29% 52.29% - Complexity 3256 3257 +1 ========================================= Files 525 525 Lines 15184 15185 +1 Branches 2887 2887 ========================================= + Hits 7940 7941 +1 Misses 6920 6920 Partials 324 324 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.