We are given either:
We assume this 2D Cartesian space is a perspective projection of a 2D space.
I may be wrong but I believe right-angled rectangles impose a constraint such that not every set of 4 such points or lines can fit a 2D perspective mapping of a rotated rectangle.
I'd like to know how to check whether the given inputs can map to a rectangle in 3D space.
If my assumption is wrong, then explaining why is also an acceptable answer.
All triplets of points should not be collinear.
Points should form convex quadrangle. In some cases non-convexity might be solved by point order flipping (Z-form, and order is not fixed), in some cases - cannot be solved (spinner-form)
Impossible cases for lines - when three of them intersect in the same point. They should provide four, five or six different intersection points (This issue includes case when three lines are parallel)