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