Commit Graph

14 Commits

Author SHA1 Message Date
Indolyn Yi
2da0465fe0 feat(geometry): Add Bentley-Ottmann algorithm for line segment intersection (#6871)
* feat(geometry): add Bentley-Ottmann line segment intersection algorithm

- Implement sweep-line algorithm for finding all intersection points
- Time complexity: O((n + k) log n) where n is segments, k is intersections
- Uses event queue (PriorityQueue) and status structure (TreeSet)
- Handles vertical/horizontal segments, collinear overlaps, and touching endpoints
- Includes comprehensive Javadoc with examples and references

* test(geometry): add comprehensive tests for Bentley-Ottmann algorithm

- 19 test cases covering typical, edge, and degenerate cases
- Tests include: single/multiple intersections, parallel segments, grid patterns
- Performance test with 100 random segments
- All tests validate correctness of intersection detection

* style(geometry): fix code style

* test(geometry): Achieve 100% test coverage for BentleyOttmann

* style(geometry): fix code style again

* fix: correct import order in BentleyOttmann

* fix(geometry): Resolve SpotBugs and PMD static analysis warnings

* Reorder import statements in BentleyOttmannTest

---------

Co-authored-by: Deniz Altunkapan <deniz.altunkapan@outlook.com>
2025-10-25 22:18:45 +02:00
Indole Yi
d5289b92da Fix ConvexHull to return points in counter-clockwise order (#6810)
* Fix ConvexHull to return points in counter-clockwise order

- Add sortCounterClockwise method to ensure CCW ordering
- Start from bottom-most, left-most point for deterministic results
- Fix issue where unordered HashSet broke downstream algorithms
- Add comprehensive tests with CCW order verification

* test(geometry): Achieve 100% test coverage for ConvexHull
2025-10-19 18:17:19 +00:00
Saahil Mahato
b312567dc3 feat: add DDA line drawing algorithm (#6616)
* feat: add DDA line drawing algorithm

* refactor: clang formatting

---------

Co-authored-by: Deniz Altunkapan <deniz.altunkapan@outlook.com>
2025-10-18 11:41:01 +00:00
Saahil Mahato
79dc71db89 feat: add wu's line drawing algorithm (#6695)
* feat: add wu's line drawing algorithm

* refactor: reorganize internal class declaration

---------

Co-authored-by: a <alexanderklmn@gmail.com>
2025-10-07 21:42:53 +02:00
Priyanshu Kumar Singh
9484c7eead FEAT(geometry): Add Haversine formula and fix build issues (#6650)
[FEAT] Implemented Haversine Formula

Co-authored-by: Priyanshu1303d <priyanshu130d@gmail.com>
2025-10-05 20:28:06 +02:00
justakayy
c7af421dfa test: PointTest.java #HSFDPMUW (#6391)
* test: added Tests for Point.java

* style: fixed formatting and comments

* style: formatted with clang-format and renamed variables

* style: fixed imports to not use the '.*' form

---------

Co-authored-by: Aaron <aaron@hochschule.de>
Co-authored-by: Deniz Altunkapan <93663085+DenizAltunkapan@users.noreply.github.com>
2025-07-20 09:59:18 +02:00
Saahil Mahato
7cf568c975 Add midpoint circle algorithm (#5868) 2024-10-26 11:50:33 +00:00
Saahil Mahato
70adf6f223 Add midpoint ellipse algorithm (#5870) 2024-10-26 09:49:10 +00:00
Saahil Mahato
be70801aa2 feat: add bresenham's line drawing algorithm (#5779) 2024-10-15 09:12:58 +00:00
Hardik Pawar
1dfa2e571b feat: Add ConvexHull new algorithm with Junit tests (#5789) 2024-10-14 17:51:59 +00:00
Piotr Idzik
f010a47608 chore: enforce InsertNewlineAtEOF in clang-format (#4343)
* style: insert newline at eof

* style: use `InsertNewlineAtEOF` in `clang-format`

* fix: use `clang-format-16`

* chore: update clang-format-lint-action to v0.16.2

---------

Co-authored-by: Debasish Biswas <debasishbsws.dev@gmail.com>
2023-09-01 04:10:46 +00:00
acbin
415a04ea7f Add automatic linter (#4214) 2023-06-09 20:05:14 +08:00
acbin
00282efd8b style: format code (#4212)
close #4204
2023-06-09 18:52:05 +08:00
Stronshade
6d13d95e41 Graham scan algorithm (#3903)
* Added Graham scan algorithm #3894

* Added Graham scan algorithm (#3894)

---------

Co-authored-by: Stronshade <diegobrocker1999@gmail.com>
2023-02-25 18:31:51 +05:30