Path: news.mathworks.com!not-for-mail From: <HIDDEN> Newsgroups: comp.soft-sys.matlab Subject: Re: Quadratic Cost Function x^T Q x Date: Thu, 20 May 2010 23:09:04 +0000 (UTC) Organization: Imperial College London Lines: 17 Message-ID: <ht4feg$q4b$1@fred.mathworks.com> References: <ht3lnt$92i$1@fred.mathworks.com> <ht3oj8$gpr$1@fred.mathworks.com> <ht3tl0$mbi$1@fred.mathworks.com> <ht3vtl$o1d$1@fred.mathworks.com> <ht41ak$at$1@fred.mathworks.com> <ht42pg$8he$1@fred.mathworks.com> <ht495s$eq2$1@fred.mathworks.com> <ht4al2$jcc$1@fred.mathworks.com> <ht4bq9$4t9$1@fred.mathworks.com> <ht4em4$853$1@fred.mathworks.com> Reply-To: <HIDDEN> NNTP-Posting-Host: webapp-05-blr.mathworks.com Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: fred.mathworks.com 1274396944 26763 172.30.248.35 (20 May 2010 23:09:04 GMT) X-Complaints-To: news@mathworks.com NNTP-Posting-Date: Thu, 20 May 2010 23:09:04 +0000 (UTC) X-Newsreader: MATLAB Central Newsreader 1192337 Xref: news.mathworks.com comp.soft-sys.matlab:637851 > You mean x is a vector of homogeneous coordinates!?! > > This seems like a really dubious idea. If all this is really just to fit a line, why don't you just use polyfit? It would be much faster and more robust. > > At any rate, if you don't constrain homogeneous coordinates in some way, your minimization problem is virtually guaranteed to be ill-conditioned. In the case of the line > > x(1)*X+x(2)*Y+x(3) > > for any solution x, another solution is c*x for any scalar c. This tends to create problems for optimization algorithms. Yes, x is a vector of homogeneous coordinates! I agree about what you say: "for any solution x, another solution is c*x for any scalar c." I experienced this, but what can I do about it? I am reading about how to do this using polyfit, I have no idea how to start, since as I said I want to compute the common tangent to a set of ellipses which is solved if x'Qx = 0. Say I have a set of ellipses in either matrix form, or of course I can write it out as a polynomial, how do I know if the line I am trying to fit is tangent to these ellipses?