public function intersect_one_line(lx, ly) result(intersections)
intersect_one_line
Find the intersections of a single line with itself.
Description
This function finds the self-intersections in a line. This is
determined by checking all possible pairs of lines segments.
The iteration starts from the first segment of the line and compares
it with all subsequent segments to find intersections. Then it goes
to the next segment and repeats the process. The intersections are
stored in an array of point type, which contains the coordinates
of the intersection points.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.