-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
gm: add geometric calculation functions #218
base: main
Are you sure you want to change the base?
Conversation
…gle area calculation, and length of missing side of a triangle calculation
WalkthroughThe changes introduce multiple public functions in the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- gm/basicgm.v (1 hunks)
Additional comments not posted (5)
gm/basicgm.v (5)
167-170
: LGTM!The
pythagorean_theorem
function correctly implements the Pythagorean theorem to calculate the hypotenuse.
172-178
: LGTM!The
euclidean_theorem
function correctly calculates the lengths of segments created by the altitude to the hypotenuse.
180-183
: LGTM!The
triangle_area_sine
function correctly calculates the area of a triangle using the sine formula.
185-189
: LGTM!The
triangle_missing_side
function correctly implements the law of cosines to calculate the missing side of a triangle.
191-197
: LGTM!The
triangle_area_from_points
function correctly calculates the area of a triangle using Heron's formula.
This PR adds several geometric calculation functions to the
gm
module. These functions implement common geometric theorems and calculations, enhancing the module's capabilities for triangle-related computations.New functions added:
These functions provide implementations for common geometric calculations, expanding the functionality of the gm module. They utilize existing structures and functions where applicable, such as the
Point
struct anddist_point_point
function.Important Note:
Currently, there is no test file for this module. Due to time constraints, I haven't been able to create a comprehensive test suite for these new functions. I acknowledge the importance of testing and commit to writing proper tests as soon as my schedule allows. I will submit a follow-up commit with a complete test file, ensuring all tests pass before merging.
This current PR is to get early feedback on the implementations while I work on the test suite.
In the meantime, I've manually verified the functions' basic functionality, but a thorough test suite is pending. I appreciate your understanding and will prioritize creating the tests at my earliest convenience.
Summary by CodeRabbit