feat: add delta x equation algorithm#231
Open
nickzerjeski wants to merge 1 commit intoTheAlgorithms:masterfrom
Open
feat: add delta x equation algorithm#231nickzerjeski wants to merge 1 commit intoTheAlgorithms:masterfrom
nickzerjeski wants to merge 1 commit intoTheAlgorithms:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a Δx (displacement) equation implementation to the maths/ algorithms set, aligning with the existing “class with .call” utility pattern and providing Minitest coverage per issue #191.
Changes:
- Introduces
DeltaX.call(initial_velocity:, time:, acceleration:)implementing Δx = v0·t + 1/2·a·t². - Adds unit tests covering zero, positive, and negative acceleration scenarios.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
maths/delta_x.rb |
Implements the Δx displacement calculation as a callable utility class. |
maths/delta_x_test.rb |
Adds Minitest cases validating the formula across acceleration sign scenarios. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
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.
Summary\n- add for the motion equation \n- add unit tests for zero, positive and negative acceleration scenarios\n\n## Testing\n- Run options: --seed 16241
Running:
...
Finished in 0.000216s, 13888.8898 runs/s, 13888.8898 assertions/s.
3 runs, 3 assertions, 0 failures, 0 errors, 0 skips\n\nFixes #191