Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Least Squares Problem Please Help

  1. Feb 22, 2007 #1
    Can someone help with the folowing?
    Suppose L1 is the line through the origin in the direction of a1 and L2 is the line through b in the direction of a2. I am supposed to find the closest points x1a1 and b+x2a2 on the two lines.

    So I am trying to find the equations that would minize ||x1a1-x2a2-b||.

    Not really sure what equations to write. I know that I'm trying to find some vector c so that (c-x1a1+x2a2+b)^2 will be the minimum. This means that if I take the derivative of the above, then the derivative will be zero. So, if I break c down into its components, would I get

    2(c1-x1a1)+2(c2+x2a2+b)=0? Or, would I be trying to find the projection of x2a2+b onto a1? And if I do that, would be projection from a2 onto a1 be a1(a1Ta1)-1aT? But what about for a2? Not sure if that's right either. Thanks.
  2. jcsd
  3. Feb 23, 2007 #2
    Figured out. misunderstood the problem at first. thanks.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook