Question about problem linear programming math modeling. Consider points A(4.7,−4.1,−1.5),B(−0.4,−2.4,1.9),C(−0.3,−2.1,−6.5) and D(2.7,−3.6,4.0). How to discover if segment AB has intersection different of zero with the segment CD? Formulate this problem as a linear programming problem.
jorgejasso85xvx
Answered question
2022-11-10
Question about problem linear programming math modeling Consider points A(4.7,−4.1,−1.5),B(−0.4,−2.4,1.9),C(−0.3,−2.1,−6.5) and D(2.7,−3.6,4.0). How to discover if segment AB has intersection different of zero with the segment CD? Formulate this problem as a linear programming problem.
Answer & Explanation
hocelwsmjc
Beginner2022-11-11Added 16 answers
Step 1 As I suggested above, it certainly seems to me that linear programming is a poor way to go about this. Nevertheless, this is an LP model that would accomplish this:
This is a feasibility problem: there's no objective to minimize, so I put a dummy objective of 0, as is common practice. That doesn't make the problem trivial: the linear programming algorithm must still determine valid values of or conclude that the model is infeasible. and represent the relative location on each segment: On AB, corresponds to A, corresponds to B; On CD, corresponds to C, corresponds to D. So for instance, if the solution is , these segments intersect right at their midpoint. Step 2 But this is like cracking open a peanut with a sledgehammer. Here's what I would do instead. First, solve the first two equations for and . 1. Solve the first two equations for and 2. If or , STOP; there is no intersection. 3. Check if the third equation is satisfied for this value of and . If it is, then this is your answer; if not, then there is no intersection. No need for a linear program at all; just a 2x2 linear system and a few checks. For general A,B,C,D, you'll need more checks to handle situations like collinearity. But in this case, you get just like you would with the LP.