I have a very specific set of circumstances under which I need to break a parallelogram into 2 pieces. The parallelogram obviously always have 4 vertices and the intersecting line intersects the polygon exactly 2 times. In the order in which the intersecting line points are given, the polygon area to the right of the line is the area of interest. I feel this could be solved using a linked list implementation in code but am unsure where to start. Additionally, if there is a simply geometry function to get the job done, that is acceptable too (I've tried intersection and difference but neither applies to the situation). An example is attached below.
Polygon vertices are given in clockwise order starting from the upper-right-most point.
The intersecting line can have 2 or more points. (In the case of 2, that means that the same intersecting ling segments intersects 2 of the parallelogram's sides.
It's possible the intersecting line only intersects one side of the polygon.
The area of interest is the upper-right area of the polygon that is closed off by the line. This implies that in this case, the intersecting lines' vertex order is 1) the point to the right, 2) the point in the center, 3) the point at the top.
These are a few more possible cases where the area of interest is shaded (please excuse my poor drawings!).