original_docstring: 
      Resolves the collision between a disc and a segment
      
docstring: Resolves the collision between a disc and a segment
docstring_tokens: Resolves the collision between a disc and a segment
code: def resolve_disc_segment_collision(disc: Disc, segment: Segment) -> None:
      """
      Resolves the collision between a disc and a segment
      """
      if segment.curve == 0:
          dist, normal = resolve_disc_segment_collision_no_curve(disc, segment)
      else:
          dist, normal = resolve_disc_segment_collision_curve(disc, segment)
  
      if dist is not None and normal is not None:
          dist, normal = segment_apply_bias(segment, dist, normal)
  
          if dist < disc.radius:
              disc.position += normal * (disc.radius - dist)
              normal_velocity = np.dot(disc.velocity, normal)
              if normal_velocity < 0:
                  bouncing_factor = -(
                      1 + disc.bouncing_coefficient * segment.bouncing_coefficient
                  )
                  disc.velocity += normal * normal_velocity * bouncing_factor
  
      return
code_tokens: def resolve_disc_segment_collision ( disc : Disc , segment : Segment ) -> None : if segment . curve == 0 : dist , normal = resolve_disc_segment_collision_no_curve ( disc , segment ) else : dist , normal = resolve_disc_segment_collision_curve ( disc , segment ) if dist is not None and normal is not None : dist , normal = segment_apply_bias ( segment , dist , normal ) if dist < disc . radius : disc . position += normal * ( disc . radius - dist ) normal_velocity = np . dot ( disc . velocity , normal ) if normal_velocity < 0 : bouncing_factor = - ( 1 + disc . bouncing_coefficient * segment . bouncing_coefficient ) disc . velocity += normal * normal_velocity * bouncing_factor return
short_docstring: Resolves the collision between a disc and a segment
short_docstring_tokens: Resolves the collision between a disc and a segment
comment: """
      Resolves the collision between a disc and a segment
      """