Skip to content

Conversation

@Priyanshu1303d
Copy link
Contributor

This PR adds a new, general-purpose algorithm that calculates the time of flight, horizontal range, and maximum height for a projectile launched from any non-negative initial height in ProjectileMotion.java


  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized it.
  • All filenames are in PascalCase.
  • All functions and variable names follow Java naming conventions.
  • All new algorithms have a URL in their comments that points to Wikipedia or other similar explanations.
  • All new code is formatted with clang-format -i --style=file src\main\java\com\thealgorithms\physics\ProjectileMotion.java

This returns all calculated values in a single, convenient Result object. I have run the tests locally, and all cases pass successfully.

@codecov-commenter
Copy link

codecov-commenter commented Oct 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.17%. Comparing base (e21aee8) to head (83c8b3c).

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6928      +/-   ##
============================================
+ Coverage     78.15%   78.17%   +0.02%     
- Complexity     6503     6509       +6     
============================================
  Files           741      742       +1     
  Lines         21675    21697      +22     
  Branches       4236     4237       +1     
============================================
+ Hits          16940    16962      +22     
  Misses         4063     4063              
  Partials        672      672              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Priyanshu1303d Priyanshu1303d force-pushed the feat/projectile-motion-v2 branch from 1d42209 to 4561ebd Compare October 25, 2025 13:28
@Priyanshu1303d Priyanshu1303d force-pushed the feat/projectile-motion-v2 branch from 4561ebd to a9df3f6 Compare October 25, 2025 13:35
@Priyanshu1303d
Copy link
Contributor Author

Priyanshu1303d commented Oct 25, 2025

Hello @alxkm @DenizAltunkapan @yanglbme ,

I had to close a couple of previous attempts now re-submitted as PR (#6855) and this PR due to some persistent CI errors that seemed related to older tests inherited from the master branch specifically from MonteCarloIntegrationTest.

So i created these new PRs from fresh branches specifically to resolve those issues and ensure a clean build.

Hoping to get these contributions reviewed and possibly merged for Hacktoberfest! 🎃

Could you please take a look when you have a moment? Thanks so much for your time and help!

@DenizAltunkapan DenizAltunkapan merged commit 2521556 into TheAlgorithms:master Oct 25, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants