Line segment intersection

intersect_line_segments is based on https://stackoverflow.com/a/565282/13332779.
Line segment A
P0
P1
Line segment B
P0
P1