from math import sqrt def distance(a: tuple[float, float], b: tuple[float, float]) -> float: """Calculate the distance between two points using the Euclidean distance formula.""" return sqrt((b[0] - a[0]) ** 2 + (b[1] - a[1]) ** 2) def dotsOverlap( x1: float, y1: float, r1: float, x2: float, y2: float, r2: float ) -> bool: """Check if two circles overlap.""" d = distance((x1, y1), (x2, y2)) return d <= (r1 + r2) print("Testing dotsOverlap()...") assert dotsOverlap(0, 0, 2, 3, 0, 2) == True assert dotsOverlap(0, 0, 2, 5, 0, 2) == False assert dotsOverlap(0, 0, 2, 4, 0, 2) == True assert dotsOverlap(-4, 5, 2, -3, 5, 5) == True assert dotsOverlap(3, 3, 3, 3, -3, 2.99) == False assert dotsOverlap(3, 3, 3, 3, -3, 3) == True assert dotsOverlap(5, 3, 0, 5, 3, 0) == True print("Passed!")