if overlap >= 0:
    tangent = math.atan2(dy, dx)
ball.angle = 2 * tangent - ball.angle
ball.speed *= elasticity
angle = 0.5 * math.pi + tangent
ball.x += math.sin(angle) * overlap
ball.y -= math.cos(angle) * overlap
Python & Pygame: столкновение мяча с внутренней частью круга