How ugly things get depends on whether the answer can be numeric only or needs to be an algebraic expression. The numeric approach is straightforward:
1. Write a single expression for the qty to be minimized. In this case, the sum of distances between an unknown point x*, y* and the three lines. Hint: it is a LOT easier to deal with distance squared rather than distance.
2. There are 5 unknowns: the coordinates of the point x*, y* and x-values on the three lines that represent the location of the shortest distance (the y-values come from the equations of the lines). Note: we all know the shortest distance to each line happens to be normal to the line, but that can be completely ignored when treating this as a simple function minimization problem.
3. Set partial derivatives of the fuction (i.e. sum of squared distances) with respect to each of the 5 unknowns equal to zero
4. Result is a 5 x 5 linear matrix equation that can be solved numerically for the 5 unknowns. The 5 equations could, in fact, be solved algebraically, but that would be quite ugly.
An algebraic approach can be as follows:
1. Assume a fixed point x*, y* and use calculus to find the shortest distance to one of the lines. Result is an algebraic expression for the x-value on the line in terms of x*, y* and known line parameters. Same result could be obtained using geometry.
2. Repeat step 1. for the remaining 2 lines. This can be done by inspection.
3. Write a single expression for the qty to be minimized. In this case, there will only be two unknowns (x*, y*). Setting partial derivatives wrt to the unknowns equal to zero results in two equations and two unknowns that can be readily solved algebraically. Ugly for sure.
takbq2 said:
This is supposed to be an easy question and I am stupidly missing something big.
If this is suppose to be an easy question, then I'm missing something also. Lagrange multipliers? Hmmm...maybe.