-
-
Couldn't load subscription status.
- Fork 7.6k
Enhance projectile motion calculations with validation #3049
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
BarathiShankar
wants to merge
1
commit into
TheAlgorithms:master
from
BarathiShankar:Updated_Physics_Projectile
Open
Enhance projectile motion calculations with validation #3049
BarathiShankar
wants to merge
1
commit into
TheAlgorithms:master
from
BarathiShankar:Updated_Physics_Projectile
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Added input validation and constants for rounding precision in projectile motion calculations. Fixed some typos Updated test function for self testing
@BarathiShankar
BarathiShankar
requested review from
Panquesito7 and
realstealthninja
as code owners
October 22, 2025 06:31
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Change
This PR improves the ground_to_ground_projectile_motion module by:
Adding input validation to ensure velocity is non-negative and angle is within 0–90°
Defining constants for rounding precision (ROUND_PRECISION_2, ROUND_PRECISION_3) and floating-point tolerance (EPSILON)
Updating the test() function to use tolerance-based assertions for floating-point comparison
Fixing documentation typos, including correcting the comment for degrees_to_radians
Adding Doxygen-style comments for all new constants and functions
These changes maintain the original output format and ensure all tests pass successfully.
Checklist
[x] Added file name matches File name guidelines
[x] Added documentation so that the program is self-explanatory and educational - Doxygen guidelines
[x] Relevant documentation/comments is changed or added
[x] Search previous suggestions before making a new one, as yours may be a duplicate