Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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
base: master
Choose a base branch
Loading
from BarathiShankar:Updated_Physics_Projectile

Conversation

@BarathiShankar
Copy link

@BarathiShankar BarathiShankar commented Oct 22, 2025

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

Added input validation and constants for rounding precision in projectile motion calculations.
Fixed some typos
Updated test function for self testing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Panquesito7 Panquesito7 Awaiting requested review from Panquesito7 Panquesito7 is a code owner

@realstealthninja realstealthninja Awaiting requested review from realstealthninja realstealthninja is a code owner

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /