homework_04/01_Alexander_Yordanov/main_task.py
def find_relative_position(self, another_circle):
        assert isinstance(another_circle, Circle)

        distance = math.sqrt((another_circle.center.x - self.center.x) ** 2 + \
            (another_circle.center.y - self.center.y) ** 2)
        
        sumOfTheRadius = self.radius + another_circle.radius
        subOfTheRadius = self.radius - another_circle.radius


        '''
        All the case we have to check for positions.
        '''

        if self.center.x == another_circle.center.x and self.center.y == another_circle.center.y \
            or abs(distance) < abs(subOfTheRadius):
            return ReturnTypes.SAME

        elif abs(distance) > sumOfTheRadius:
            return ReturnTypes.NO_COMMON_POINTS

        elif abs(distance) == sumOfTheRadius or abs(distance) == abs(subOfTheRadius):
            return ReturnTypes.TOUCHING

        elif abs(subOfTheRadius) < abs(distance) < sumOfTheRadius:
            return ReturnTypes.INTERSECTING

        All the case we have to check for positions.
        
All the case we have to check for positions.
All the case we have to check for positions .
def find_relative_position(self, another_circle):
        assert isinstance(another_circle, Circle)
        distance = math.sqrt((another_circle.center.x - self.center.x) ** 2 + \
            (another_circle.center.y - self.center.y) ** 2)
        sumOfTheRadius = self.radius + another_circle.radius
        subOfTheRadius = self.radius - another_circle.radius
        if self.center.x == another_circle.center.x and self.center.y == another_circle.center.y \
            or abs(distance) < abs(subOfTheRadius):
            return ReturnTypes.SAME
        elif abs(distance) > sumOfTheRadius:
            return ReturnTypes.NO_COMMON_POINTS
        elif abs(distance) == sumOfTheRadius or abs(distance) == abs(subOfTheRadius):
            return ReturnTypes.TOUCHING
        elif abs(subOfTheRadius) < abs(distance) < sumOfTheRadius:
            return ReturnTypes.INTERSECTING
def find_relative_position ( self , another_circle ) : assert isinstance ( another_circle , Circle ) distance = math . sqrt ( ( another_circle . center . x - self . center . x ) ** 2 + ( another_circle . center . y - self . center . y ) ** 2 ) sumOfTheRadius = self . radius + another_circle . radius subOfTheRadius = self . radius - another_circle . radius if self . center . x == another_circle . center . x and self . center . y == another_circle . center . y or abs ( distance ) < abs ( subOfTheRadius ) : return ReturnTypes . SAME elif abs ( distance ) > sumOfTheRadius : return ReturnTypes . NO_COMMON_POINTS elif abs ( distance ) == sumOfTheRadius or abs ( distance ) == abs ( subOfTheRadius ) : return ReturnTypes . TOUCHING elif abs ( subOfTheRadius ) < abs ( distance ) < sumOfTheRadius : return ReturnTypes . INTERSECTING
All the case we have to check for positions.
All the case we have to check for positions .
'''
        All the case we have to check for positions.
        '''
self
another_circle