http://www.mathworks.com/matlabcentral/newsreader/view_thread/324370
MATLAB Central Newsreader  Fit paraboloid to measured x,y,z coordinates
Feed for thread: Fit paraboloid to measured x,y,z coordinates
enus
©19942014 by MathWorks, Inc.
webmaster@mathworks.com
MATLAB Central Newsreader
http://blogs.law.harvard.edu/tech/rss
60
MathWorks
http://www.mathworks.com/images/membrane_icon.gif

Thu, 08 Nov 2012 21:05:19 +0000
Fit paraboloid to measured x,y,z coordinates
http://www.mathworks.com/matlabcentral/newsreader/view_thread/324370#891274
Daniel Moka
Hello!<br>
<br>
First, I wanna thanks everybody who'll spend his time to work on my<br>
problem.<br>
<br>
I have measured an object with geodetic total stations. i have X,Y,Z coordinates of the object. I would like to fit a paraboloid to my x,y,z coordinates and deterrmine the deviation (dy,dy,dz) between my measured object and a theoretical paraboloid.<br>
<br>
(My object is similar to this : <a href="http://goo.gl/wUmiK">http://goo.gl/wUmiK</a> )<br>
<br>
Of course, i already have 3 coloumn vector of x y and z coordinates in matlab.<br>
<br>
Thank you all!<br>
<br>
Have a nice day!<br>
<br>
Daniel

Fri, 09 Nov 2012 08:02:16 +0000
Re: Fit paraboloid to measured x,y,z coordinates
http://www.mathworks.com/matlabcentral/newsreader/view_thread/324370#891302
Roger Stafford
"Daniel Moka" <mokadaniel@citromail.hu> wrote in message <k7h6qf$q3a$1@newscl01ah.mathworks.com>...<br>
> I have measured an object with geodetic total stations. i have X,Y,Z coordinates of the object. I would like to fit a paraboloid to my x,y,z coordinates and deterrmine the deviation (dy,dy,dz) between my measured object and a theoretical paraboloid.<br>
> (My object is similar to this : <a href="http://goo.gl/wUmiK">http://goo.gl/wUmiK</a> )<br>
        <br>
If your "object" is one of those antennae pictured at the website you mentioned, it appears to be a circular paraboloid, which would make things quite a bit easier. Is that the kind of paraboloid you are trying to fit your points to?<br>
<br>
Roger Stafford

Fri, 09 Nov 2012 09:32:17 +0000
Re: Fit paraboloid to measured x,y,z coordinates
http://www.mathworks.com/matlabcentral/newsreader/view_thread/324370#891309
Daniel Moka
"Roger Stafford" wrote in message <k7ida8$3ui$1@newscl01ah.mathworks.com>...<br>
> "Daniel Moka" <mokadaniel@citromail.hu> wrote in message <k7h6qf$q3a$1@newscl01ah.mathworks.com>...<br>
> > I have measured an object with geodetic total stations. i have X,Y,Z coordinates of the object. I would like to fit a paraboloid to my x,y,z coordinates and deterrmine the deviation (dy,dy,dz) between my measured object and a theoretical paraboloid.<br>
> > (My object is similar to this : <a href="http://goo.gl/wUmiK">http://goo.gl/wUmiK</a> )<br>
>         <br>
> If your "object" is one of those antennae pictured at the website you mentioned, it appears to be a circular paraboloid, which would make things quite a bit easier. Is that the kind of paraboloid you are trying to fit your points to?<br>
> <br>
> Roger Stafford<br>
<br>
<br>
Thank you for your reply!<br>
<br>
To be honest, i am a little bit greenhorn at this topic :\ My teacher told me, i have to fit a rotation paraboloid to my x,y,z coordinates, and determine the deviations. I have alredy fitted a ball(sphere) to these coordinates, and determined the deviations.<br>
The result is the following : for example for the first 2 points :<br>
<br>
2012.11.06 11:02  Ball (sphere)<br>
Y0 = 2.388 X0 = 0.503 Z0 = 4.005 R = 0.309<br>
<br>
Point y x z dy dx dz dr<br>
3 2.220 0.636 4.235 0.003 0.002 0.004 0.005<br>
4 2.215 0.644 4.226 0.002 0.002 0.004 0.005<br>
<br>
This ball fitting task was easy to do, because there is a program(created by my teacher) which can solve that.<br>
<br>
Responsing to your question, yes, my object is something like that paraboloid at website, and i should fit same paraboloid to this. i am going to university today (where the parabola is) and i am going to take a picture of that, then i will put it here to this message.<br>
<br>
i am sorry for my bad english, it is long time since i have used it, nowadays i am trying to improve it...<br>
<br>
Daniel

Fri, 09 Nov 2012 17:09:20 +0000
Re: Fit paraboloid to measured x,y,z coordinates
http://www.mathworks.com/matlabcentral/newsreader/view_thread/324370#891352
Roger Stafford
"Daniel Moka" <mokadaniel@citromail.hu> wrote in message <k7iij1$kht$1@newscl01ah.mathworks.com>...<br>
> To be honest, i am a little bit greenhorn at this topic :\ My teacher told me, i have to fit a rotation paraboloid to my x,y,z coordinates, and determine the deviations.<br>
> ........<br>
> Responsing to your question, yes, my object is something like that paraboloid at website, and i should fit same paraboloid to this.<br>
        <br>
I am willing help you with your homework to the extent of finding the distance from a given point to the closest point of a given circular paraboloid (that is, a surface obtained by revolving a parabola around its axis.)<br>
<br>
Such a paraboloid can be characterized by a vector of the three cartesian coordinates of its intersection with its central axis, A, and those of its focal point, F. Let P be the coordinates of one of your points and designate Q as the coordinates of the closest point to P on the paraboloid. The plane through triangle PAF cuts the paraboloid in a parabola and Q must lie in this plane on this parabola. Let U and V be the distances in this plane from A to P orthogonal to the line FA and along it, respectively. Then compute them:<br>
<br>
f = norm(FA);<br>
j = (FA)/f; % Unit vector along FA<br>
U = norm(cross(PA,j));<br>
V = dot(PA,j);<br>
<br>
Let u,v be corresponding distances for Q, so they must satisfy v = u^2/(4*f) along the parabola. We must minimize the distance between P and Q<br>
<br>
D = sqrt((uU)^2+(vV)^2) = sqrt((uU)^2+(u^2/(4*f)V)^2)<br>
<br>
By setting its derivative with respect to u to zero we get<br>
<br>
u^3/(4*f^2)+(2V/f)*u2*U = 0<br>
<br>
which is a cubic equation in u. This can be solved using matlab's 'roots' function. The answer will be either one real and two complex roots or three real roots. You would either choose the single real root in the former case or the positive u in the latter case. Then find v:<br>
<br>
v = u^2/(4*f);<br>
<br>
Then the distance between P and its closest point Q would be the above expression for D.<br>
<br>
Presumably you would either use matlab's 'fminsearch' or 'lsqnonlin' of the optimization toolbox to search for the least squares solution for your set of given points with the six variable parameters being the three coordinates of A and those of F.<br>
<br>
To recover the x,y,z coordinates of each Q point from its associated u and v values, do this<br>
<br>
Q = A + u/U*cross(j,cross(PA,j)) + v*j; <br>
<br>
This would enable you to evaluate your optimum dx, dy, and dz values for the given points from the vector PQ.<br>
<br>
Roger Stafford

Fri, 09 Nov 2012 21:48:23 +0000
Re: Fit paraboloid to measured x,y,z coordinates
http://www.mathworks.com/matlabcentral/newsreader/view_thread/324370#891376
Daniel Moka
ohh man, i do appreciate your help!<br>
<br>
Tomorrow, i am going to try to solve this task wtih your informations, after that i will write a message here with my results!<br>
<br>
By the way, i have taken some picture...if you are interested in it:<br>
<a href="http://goo.gl/1FbRt">http://goo.gl/1FbRt</a><br>
<a href="http://goo.gl/ziE6A">http://goo.gl/ziE6A</a><br>
<br>
Thank you !<br>
<br>
Have a nice weekend!<br>
<br>
Daniel