Let's say I have 9 points on a plane and following image shows the sequence by which I put lines (vertices) on those points.
and I keep track of points and lines both separately in a vector. And now I put another line (that can be anywhere) but following is what plain looks like now
How can I find out that 6th vertex (or recently added vertex) makes four sided box (doesn't have to be just square, as long as they make enclosed box—that's it).
I understand finding the distance between two lines/vertices can be a good start, but can someone please explain how is this going to be?