-
Notifications
You must be signed in to change notification settings - Fork 20.4k
Proposal: Add Rotating Calipers Algorithm to Geometry Package #6674
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
base: update-directory
Are you sure you want to change the base?
Proposal: Add Rotating Calipers Algorithm to Geometry Package #6674
Conversation
Overview This proposal suggests adding the Rotating Calipers algorithm to the geometry package. The Rotating Calipers technique enables efficient geometric computations for convex polygons, specifically: Diameter (largest distance between any two points of a convex polygon) Width (smallest distance between two parallel lines enclosing the polygon) Minimum-area bounding rectangle (rectangle of minimal area enclosing all points) Purpose Integrating Rotating Calipers will: Enhance the geometry module with essential computational geometry algorithms. Foster educational exploration of convex polygon properties. Align with repository goals for well-documented, quality algorithms. Implementation A single, fully static and final class: RotatingCalipers. All methods have complete JavaDoc documentation. Comprehensive JUnit 5 unit tests covering both simple and complex cases. Follows repository CheckStyle, formatting, and naming conventions (static/final, clear method names, etc.). References Shamos, M.I. (1978). Computational Geometry. Wikipedia: Rotating Calipers. Issue Details Algorithm Name: Rotating Calipers Problem Statement: Given a set of points representing a convex polygon, efficiently compute its diameter, width, and minimum-area bounding rectangle using the rotating calipers technique. Algorithm Description: Compute the convex hull of the input points. Apply rotating calipers to find the geometric property (diameter, width, rectangle). Return results in proper data structures (e.g., PointPair, Rectangle). Benefits Educational: Learners can explore fundamental convex polygon properties interactively. Repository Extension: Adds a robust, unit-tested geometric algorithm, maintaining educational and quality standards. Implementation Details All methods are static and class is final. Full JavaDoc coverage. All new code meets project CheckStyle, naming, and formatting rules. All new tests use JUnit 5. The PR changes only geometry package files; any unrelated CI failures (e.g., in BloomFilterTest) are not a result of this submission.
Thank you for confirming. The previous proposal is now fully prepared and ready for use in your pull request or contribution documentation. This formal structure ensures all aspects—educational purpose, algorithm functionality, implementation standards, and references—are clearly communicated and meet the requirements for collaborative or open-source repositories, including Hacktoberfest submissions. |
760ed63
to
a2ada7c
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## update-directory #6674 +/- ##
======================================================
+ Coverage 75.75% 75.87% +0.11%
- Complexity 5773 5793 +20
======================================================
Files 703 704 +1
Lines 19777 19869 +92
Branches 3832 3844 +12
======================================================
+ Hits 14983 15075 +92
Misses 4215 4215
Partials 579 579 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…alipers Fix Checkstyle violations by removing trailing whitespace and ensuring proper file endings in the RotatingCalipers class and test files.
1db39c7
to
c63ffff
Compare
Overview
This proposal suggests adding the Rotating Calipers algorithm to the geometry package. The Rotating Calipers technique enables efficient geometric computations for convex polygons, specifically:
Diameter (largest distance between any two points of a convex polygon)
Width (smallest distance between two parallel lines enclosing the polygon)
Minimum-area bounding rectangle (rectangle of minimal area enclosing all points)
Purpose
Integrating Rotating Calipers will:
Enhance the geometry module with essential computational geometry algorithms.
Foster educational exploration of convex polygon properties.
Align with repository goals for well-documented, quality algorithms.
Implementation
A single, fully static and final class: RotatingCalipers.
All methods have complete JavaDoc documentation.
Comprehensive JUnit 5 unit tests covering both simple and complex cases.
Follows repository CheckStyle, formatting, and naming conventions (static/final, clear method names, etc.).
References
Shamos, M.I. (1978). Computational Geometry.
Wikipedia: Rotating Calipers.
Issue Details
Algorithm Name: Rotating Calipers
Problem Statement:
Given a set of points representing a convex polygon, efficiently compute its diameter, width, and minimum-area bounding rectangle using the rotating calipers technique.
Algorithm Description:
Compute the convex hull of the input points.
Apply rotating calipers to find the geometric property (diameter, width, rectangle).
Return results in proper data structures (e.g., PointPair, Rectangle).
Benefits
Educational: Learners can explore fundamental convex polygon properties interactively.
Repository Extension: Adds a robust, unit-tested geometric algorithm, maintaining educational and quality standards.
Implementation Details
All methods are static and class is final.
Full JavaDoc coverage.
All new code meets project CheckStyle, naming, and formatting rules.
All new tests use JUnit 5.
The PR changes only geometry package files; any unrelated CI failures (e.g., in BloomFilterTest) are not a result of this submission.
clang-format -i --style=file path/to/your/file.java