Skip to content

I Fixed is_in() in ball.h , which measures distance from origin(incorrect as centre keeps changing) instead of actual center.#474

Open
DhanushShetty18 wants to merge 2 commits intoGeomScale:developfrom
DhanushShetty18:fix/ball-is-in-origin-bug
Open

I Fixed is_in() in ball.h , which measures distance from origin(incorrect as centre keeps changing) instead of actual center.#474
DhanushShetty18 wants to merge 2 commits intoGeomScale:developfrom
DhanushShetty18:fix/ball-is-in-origin-bug

Conversation

@DhanushShetty18
Copy link
Copy Markdown

@DhanushShetty18 DhanushShetty18 commented Mar 13, 2026

While studying for GSOC 2026,
I found a bug in is_in() which checks:
' p.squared_length() <= R '
This measures distance from p to the origin.
But Ball stores a center c which is computed

FIX :

Changed to (p - c).squared_length() <= R

This measures distance from p to the changing actual center c.
where Ball objects have non-origin centers.

Added a test case in test_internal_points.cpp that verifies
is_in works correctly with a non-origin center.

Also Verified with
full_dimensional_polytope_test
9 tests, 38 assertions, 0 failures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant