I have a set of line segments that are defined as a connection between two arbitrary points (e.g. $(x_1,y_1)$ and $(x_2,y_2)$). I need to find a line $y=mx+b$ that intersects all the line segments in the set at any one point. I understand linear programming is able to help with this, I am however not sure about the constraints. I believe that if the line segments are e.g. just vertical, a constraint like in this answer could work, but I am uncertain how this can be done if the line segments can have any direction.
I am new to linear programming so please excuse any mistakes in my question.
Thanks in advance