(center_x, center_y, source_x, source_y, width, height=None)
return center_x + f * width / 2, center_y + (1 - f) * height / 2
Determines where the rhombus centered at (center_x, center_y)
        intersects with a line drawn from (source_x, source_y) to
        (center_x, center_y).

        @see: ShapeDrawer.intersection_point
Determines where the rhombus centered at (center_x, center_y)
        intersects with a line drawn from (source_x, source_y) to
        (center_x, center_y).
Determines where the rhombus centered at ( center_x center_y ) intersects with a line drawn from ( source_x source_y ) to ( center_x center_y ) .
def intersection_point(center_x, center_y, source_x, source_y, width, height=None):
        """Determines where the rhombus centered at (center_x, center_y)
        intersects with a line drawn from (source_x, source_y) to
        (center_x, center_y).

        @see: ShapeDrawer.intersection_point"""
        height = height or width

        if height == 0 and width == 0:
            return center_x, center_y

        delta_x, delta_y = source_x - center_x, source_y - center_y

        # Treat edge case when delta_x = 0
        if delta_x == 0:
            if delta_y == 0:
                return center_x, center_y
            else:
                return center_x, center_y + copysign(height / 2, delta_y)

        width = copysign(width, delta_x)
        height = copysign(height, delta_y)

        f = height / (height + width * delta_y / delta_x)
        return center_x + f * width / 2, center_y + (1 - f) * height / 2
def intersection_point ( center_x , center_y , source_x , source_y , width , height = None ) : height = height or width if height == 0 and width == 0 : return center_x , center_y delta_x , delta_y = source_x - center_x , source_y - center_y # Treat edge case when delta_x = 0 if delta_x == 0 : if delta_y == 0 : return center_x , center_y else : return center_x , center_y + copysign ( height / 2 , delta_y ) width = copysign ( width , delta_x ) height = copysign ( height , delta_y ) f = height / ( height + width * delta_y / delta_x ) return center_x + f * width / 2 , center_y + ( 1 - f ) * height / 2