From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Vectors on ellipsoid surface
Date: Mon, 24 May 2010 17:45:08 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 43
Message-ID: <htedv4$l4n$>
References: <ht5ldf$7tf$> <hta8lc$e4f$> <htai71$i38$> <htaqsk$5h1$> <htba3v$iq3$> <htbekb$afo$> <htbpdd$e9i$> <htd8kj$qbn$> <htdetc$c98$> <htdgr5$h9p$> <htds3s$r3p$> <hte4oq$7se$> <hte79n$sa9$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1274723108 21655 (24 May 2010 17:45:08 GMT)
NNTP-Posting-Date: Mon, 24 May 2010 17:45:08 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1140591
Xref: comp.soft-sys.matlab:638797

Dear Bruno,

This is amazing, i must agree with Mark. Such a 'simple' question evaluates to a great contribution. I do not know how to thank you. My thesis on kinematics of ligaments in the knee will improve really much with this. 

I added this code to EllGeo2Alg

radii = reshape(radii, 1, []);
W = bsxfun(@rdivide, U, radii);
A = W*W';
b = -2*A*x0;
c = x0'*A*x0-1;

B=null((P1(:)-P2(:))') ;
b2=2*B'*A*C + B'*b;
c2=C'*A*C + b'*C + C;

So that the output of the function is now A2,b2 and C2.

So by doing the next code, I thought I would get C'.
[A2 b2 c] = EllGeo2Alg(radii, U, x0,P1,P2)
x = EllPrj(c, radii, U);

% Compute l = |x-c|
l = sqrt(sum(bsxfun(@minus, x, c).^2, 1));
% Where the distance is minimal
[lmin imin] = min(l);

Only it allready goes wrong in b2=2*B'*A*C + B'*b;
Should I transform C(0,0) to 3D before I do this? Or is my whole order of doing things wrong? 

By transforming C(0,0) to 3D I should use eq 2 (C+ B*xi), where I do know B and xi, but what parameter should I choose for C? And how can your file in the file exchanger help me with this?

Hope these questions are specific enough.

Again, thanks for all the effort and help. It is getting much clearer now.

Best wishes,