Skip to content

Bug in Circle-Circle Intersection function #22

@mitkonikov

Description

@mitkonikov

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$.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions