Check if a circle is contained in another circle
问题 I'm trying to check if a circle is contained within another circle. I'm not sure if the math behind it is the problem or if its my if statement because I keep getting True for anything I pass. #Get_center returns (x,y) #Get_radius returns radius length def contains(self,circle): distance = round(math.sqrt((circle.get_center()[0]-self.get_center()[0])**2 + (circle.get_center()[1] - self.get_center()[1])**2)) distance_2 = distance + circle.get_radius() if distance_2 > distance: return True