homework_04/08_Denis_Zahariev/circles.py
def find_relative_position(self, other) -> RelativePostion:
        '''
        In this function we determine the exact relation of two circles expressed
        with the enum above based on their distances and radiuses.
        '''

        assert isinstance(other, Circle)

        if self == other:
            return RelativePostion.SAME

        distance = np.sqrt((other.center.x - self.center.x) ** 2 + \
        (other.center.y - self.center.y) ** 2) # pitagor

        radius_sum = self.radius + other.radius
        radius_difference = abs(self.radius - other.radius)

        if distance == 0 and self.radius == other.radius:
            return RelativePostion.SAME

        if distance > radius_sum or distance < radius_difference:
            return RelativePostion.NO_COMMON_POINTS

        if distance in [radius_sum, radius_difference]:
            return RelativePostion.TOUCHING

        return RelativePostion.INTERSECTING

        In this function we determine the exact relation of two circles expressed
        with the enum above based on their distances and radiuses.
        
In this function we determine the exact relation of two circles expressed
with the enum above based on their distances and radiuses.
In this function we determine the exact relation of two circles expressed with the enum above based on their distances and radiuses .
def find_relative_position(self, other) -> RelativePostion:
        assert isinstance(other, Circle)
        if self == other:
            return RelativePostion.SAME
        distance = np.sqrt((other.center.x - self.center.x) ** 2 + \
        (other.center.y - self.center.y) ** 2) 
        radius_sum = self.radius + other.radius
        radius_difference = abs(self.radius - other.radius)
        if distance == 0 and self.radius == other.radius:
            return RelativePostion.SAME
        if distance > radius_sum or distance < radius_difference:
            return RelativePostion.NO_COMMON_POINTS
        if distance in [radius_sum, radius_difference]:
            return RelativePostion.TOUCHING
        return RelativePostion.INTERSECTING
def find_relative_position ( self , other ) -> RelativePostion : assert isinstance ( other , Circle ) if self == other : return RelativePostion . SAME distance = np . sqrt ( ( other . center . x - self . center . x ) ** 2 + ( other . center . y - self . center . y ) ** 2 ) radius_sum = self . radius + other . radius radius_difference = abs ( self . radius - other . radius ) if distance == 0 and self . radius == other . radius : return RelativePostion . SAME if distance > radius_sum or distance < radius_difference : return RelativePostion . NO_COMMON_POINTS if distance in [ radius_sum , radius_difference ] : return RelativePostion . TOUCHING return RelativePostion . INTERSECTING
In this function we determine the exact relation of two circles expressed
with the enum above based on their distances and radiuses.
In this function we determine the exact relation of two circles expressed with the enum above based on their distances and radiuses .
'''
        In this function we determine the exact relation of two circles expressed
        with the enum above based on their distances and radiuses.
        ''' # pitagor
self
other