I have a four points in plane and need to test (based on point coordinates) whether they are able to form a convex quadrilateral:
Of course, the test should avoid configurations like these:
Given the diagonals, I can check whether the quadrilateral is convex (simply checking whether the intersection of diagonals is between both ends of both diagonals).
The real problem is how to label the four points and filter out all concave and degenerate configurations (like, for example: $A=B$).
If the labeling is possible (convex case found), the four points should be labeled such that $AC$ and $BD$ are diagonals of a convex quadrialteral.
I wonder if there is an elegant solution (rather than testing every possible permutation of $A, B, C$ and $D$).