pooltool.physics.resolve.ball_ball ================================== .. py:module:: pooltool.physics.resolve.ball_ball Models for ball-ball collisions. -------------------------------- Overview -------- .. list-table:: Classes :header-rows: 0 :widths: auto :class: summarytable * - :py:obj:`FrictionalInelastic ` - A simple ball-ball collision model including ball-ball friction, and coefficient of restitution for equal-mass balls * - :py:obj:`FrictionalMathavan ` - Ball-ball collision resolver for the Mathavan et al. (2014) collision model. * - :py:obj:`FrictionlessElastic ` - A frictionless, instantaneous, elastic, equal mass collision resolver. * - :py:obj:`BallBallModel ` - An Enum for different ball-ball collision models Classes ------- .. autoclass:: FrictionalInelastic Bases: :py:obj:`pooltool.physics.resolve.ball_ball.core.CoreBallBallCollision` .. rubric:: Methods: .. py:method:: solve(ball1: pooltool.objects.ball.datatypes.Ball, ball2: pooltool.objects.ball.datatypes.Ball) -> Tuple[pooltool.objects.ball.datatypes.Ball, pooltool.objects.ball.datatypes.Ball] Resolves the collision. .. autoclass:: FrictionalMathavan Bases: :py:obj:`pooltool.physics.resolve.ball_ball.core.CoreBallBallCollision` .. rubric:: Methods: .. py:method:: solve(ball1: pooltool.objects.ball.datatypes.Ball, ball2: pooltool.objects.ball.datatypes.Ball) -> Tuple[pooltool.objects.ball.datatypes.Ball, pooltool.objects.ball.datatypes.Ball] Resolve ball-ball collision via Mathavan et al. (2014). This method computes the post-collision linear and angular velocities of two balls colliding on a rough surface, taking into account both ball-to-ball friction and ball-to-surface friction. The collision model is based on the method described by Mathavan et al. (2014), which considers point contacts and frictional impact dynamics between the balls. The function transforms the velocities and angular velocities into a local coordinate frame defined by the line connecting the centers of the two balls at the point of collision. It then iteratively calculates the collision dynamics, including the effects of friction and restitution during the compression and restitution phases of the collision. Once the collision dynamics criteria are met, the updated velocities and angular velocities are transformed back into the global coordinate frame and returned. .. autoclass:: FrictionlessElastic Bases: :py:obj:`pooltool.physics.resolve.ball_ball.core.CoreBallBallCollision` .. rubric:: Methods: .. py:method:: solve(ball1: pooltool.objects.ball.datatypes.Ball, ball2: pooltool.objects.ball.datatypes.Ball) -> Tuple[pooltool.objects.ball.datatypes.Ball, pooltool.objects.ball.datatypes.Ball] Resolves the collision. .. autoclass:: BallBallModel Bases: :py:obj:`pooltool.utils.strenum.StrEnum`