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

Implement 3D pocket-ball collision logic #179

Merged
merged 11 commits into from
Jan 20, 2025
Merged

Conversation

ekiefl
Copy link
Owner

@ekiefl ekiefl commented Jan 20, 2025

  • Pocket collision logic for 3D is added. If ball lands in pocket circle, pocket. If ball flies through with outflux height <7/5*R, the ball is pocketed. Otherwise it is not. Details in ball_pocket_collision_time_airborne docstring

  • quadratic.solve and quartic.solve now have the same ins/outs

  • quadratic.solve is now a general quadratic solver, capable of returning complex roots

  • It's also less susceptible to catastrophic cancellation (a numerical stability issue)

  • roots.core got an upgrade. Of note is filter_non_physical_roots and filter_non_physical_roots_many, which take roots and determine heuristically whether they are non-negative, finite, and have a permissibly small imaginary component. This logic existed in the quartic solver, but now has been exposed as a core functionality that can be used any collection of roots (e.g. those calculated from the quadratic solver).

@ekiefl ekiefl merged commit 8491390 into 3d Jan 20, 2025
1 check passed
@ekiefl ekiefl deleted the ek/resurrect-ball-pocket-collision branch January 20, 2025 21:31
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