http://www.mathworks.com/matlabcentral/newsreader/view_thread/285448
MATLAB Central Newsreader  draw an arc using just five points
Feed for thread: draw an arc using just five points
enus
©19942015 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

Fri, 25 Jun 2010 14:33:08 +0000
draw an arc using just five points
http://www.mathworks.com/matlabcentral/newsreader/view_thread/285448#757501
S. Ali
Hi,<br>
I want to draw an arc using just five points, would anyone help me in this case?<br>
also I need the equation of this fitted curve too.<br>
<br>
tnx<br>
<br>
ALI

Fri, 25 Jun 2010 14:49:06 +0000
Re: draw an arc using just five points
http://www.mathworks.com/matlabcentral/newsreader/view_thread/285448#757506
Roger Stafford
"S. Ali " <s.mirhadizadeh@ymail.com> wrote in message <i02en4$orh$1@fred.mathworks.com>...<br>
> Hi,<br>
> I want to draw an arc using just five points, would anyone help me in this case?<br>
> also I need the equation of this fitted curve too.<br>
> <br>
> tnx<br>
> <br>
> ALI<br>
<br>
A quartic polynomial is uniquely determined by five points along it. Also a conic section is uniquely determined by five points. I would suppose the number of possibilities of this kind is endless. What kind of "arc" or "equation" do you have in mind?<br>
<br>
Roger Stafford

Fri, 25 Jun 2010 15:07:19 +0000
Re: draw an arc using just five points
http://www.mathworks.com/matlabcentral/newsreader/view_thread/285448#757510
S. Ali
"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <i02fl2$qie$1@fred.mathworks.com>...<br>
> "S. Ali " <s.mirhadizadeh@ymail.com> wrote in message <i02en4$orh$1@fred.mathworks.com>...<br>
> > Hi,<br>
> > I want to draw an arc using just five points, would anyone help me in this case?<br>
> > also I need the equation of this fitted curve too.<br>
> > <br>
> > tnx<br>
> > <br>
> > ALI<br>
> <br>
> A quartic polynomial is uniquely determined by five points along it. Also a conic section is uniquely determined by five points. I would suppose the number of possibilities of this kind is endless. What kind of "arc" or "equation" do you have in mind?<br>
> <br>
> Roger Stafford<br>
<br>
<br>
well ,I will try them, and see how its going to look like,<br>
something like not whole Ellipse ,maybe just part of it.<br>
<br>
Regards<br>
<br>
ALI

Fri, 25 Jun 2010 21:02:23 +0000
Re: draw an arc using just five points
http://www.mathworks.com/matlabcentral/newsreader/view_thread/285448#757617
Roger Stafford
"S. Ali " <s.mirhadizadeh@ymail.com> wrote in message <i02gn7$6bu$1@fred.mathworks.com>...<br>
> well ,I will try them, and see how its going to look like,<br>
> something like not whole Ellipse ,maybe just part of it.<br>
> Regards<br>
> ALI<br>
<br>
To find the conic section that fits five points you can do the following. Let x and y be 5x1 column vectors of the cartesian coordinates of the five points. Then compute:<br>
<br>
[U,S,V] = svd([x.^2,x.*y,y.^2,x,y,ones(size(x))]);<br>
a = V(1,6); b = V(2,6); c = V(3,6); <br>
d = V(4,6); e = V(5,6); f = V(6,6);<br>
<br>
These last will be the coefficients of the conic section that contains the five points:<br>
<br>
a*x.^2 + b*x.*y + c*y.^2 + d*x + e*y + f = 0<br>
<br>
You can use ezplot to display this conic section.<br>
<br>
Note that it will turn out to be an ellipse only if the five points are so placed that b^2 < 4*a*c. If b^2 = 4*a*c, it will be a parabola and if b^2 > 4*a*c it will be a hyperbola.<br>
<br>
Also note that if you have more than five points, this procedure finds the bestfitting conic section to the points in a least squares sense.<br>
<br>
Roger Stafford