I have a set of lines joined together and a rectangle represented by 4 points. Suppose the rectangle intersects with the lines, I would like to compute the outline of this intersection operation. Can somebody suggest the algorithm that I need to use to get the desired output shown below
Input
Expected Output(shown in green lines)