Skip to content
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

Bug in Circle-Circle Intersection function #22

Open
mitkonikov opened this issue Dec 17, 2024 · 0 comments
Open

Bug in Circle-Circle Intersection function #22

mitkonikov opened this issue Dec 17, 2024 · 0 comments

Comments

@mitkonikov
Copy link

There is a bug (missing brackets) in the line where it checks if two circles are too far to even intersect.

The line is:

  if (sign(d - C.r + D.r) > 0) return {};       // too far

It should be:

  if (sign(d - (C.r + D.r)) > 0) return {};       // too far

Two circles are too far to intersect if the distance between their centers (in our case $d$) is bigger than the sum of the radii $r_0$ and $r_1$.

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

No branches or pull requests

1 participant