original_docstring: 
      Resolves the collision between a disc and a plane
      
docstring: Resolves the collision between a disc and a plane
docstring_tokens: Resolves the collision between a disc and a plane
code: def resolve_disc_plane_collision(disc: Disc, plane: Plane) -> None:
      """
      Resolves the collision between a disc and a plane
      """
      norm_plane = plane.normal / np.linalg.norm(plane.normal)
      dist = plane.distance_origin - np.dot(disc.position, norm_plane) + disc.radius
      if dist > 0:
          disc.position += norm_plane * dist
          normal_velocity = np.dot(disc.velocity, norm_plane)
          if normal_velocity < 0:
              bouncing_factor = -(
                  1 + disc.bouncing_coefficient * plane.bouncing_coefficient
              )
              disc.velocity += plane.normal * normal_velocity * bouncing_factor
code_tokens: def resolve_disc_plane_collision ( disc : Disc , plane : Plane ) -> None : norm_plane = plane . normal / np . linalg . norm ( plane . normal ) dist = plane . distance_origin - np . dot ( disc . position , norm_plane ) + disc . radius if dist > 0 : disc . position += norm_plane * dist normal_velocity = np . dot ( disc . velocity , norm_plane ) if normal_velocity < 0 : bouncing_factor = - ( 1 + disc . bouncing_coefficient * plane . bouncing_coefficient ) disc . velocity += plane . normal * normal_velocity * bouncing_factor
short_docstring: Resolves the collision between a disc and a plane
short_docstring_tokens: Resolves the collision between a disc and a plane
comment: """
      Resolves the collision between a disc and a plane
      """