Finding all quadrilaterals in a set of intersections

Viewed 1102

I want to take all the intersections of a set of lines and find all the convex quadrilaterals they create. I am not sure if there is an algorithm that works perfect for this, or if I need to loop through and create my own.

I have an array of lines, and all their intersections.

Lines and intersections:

enter image description here

Example Quadrilaterals 1:

enter image description here

Example Quadrilaterals 2 enter image description here

In this case, I would come out with 8 quadrilaterals.

How can I achieve this? If there isn't an algorithm I can implement for this, how can I check each intersection with other intersections to determine if they make a convex quadrilateral?

2 Answers
Related