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

Fix division by zero returning incorrect vector #4384

Merged
merged 5 commits into from
Oct 29, 2021

Conversation

RiccardoFrenner
Copy link
Contributor

@RiccardoFrenner RiccardoFrenner commented Oct 29, 2021

Fixes #4375

Description of changes:

  • Check if distance from center of sphere is zero and if so, return a vector with the correct length instead of {inf, inf, inf}.
  • Added unit test for the sphere shape distance function.

src/shapes/src/Sphere.cpp Show resolved Hide resolved
@jngrad jngrad added this to the Espresso 4.2 milestone Oct 29, 2021
@kodiakhq kodiakhq bot merged commit e9475e6 into espressomd:python Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Division by zero in distance calculation of sphere constraint
2 participants