Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
draw an arc using just five points

Subject: draw an arc using just five points

From: S. Ali

Date: 25 Jun, 2010 14:33:08

Message: 1 of 4

Hi,
I want to draw an arc using just five points, would anyone help me in this case?
also I need the equation of this fitted curve too.

tnx

ALI

Subject: draw an arc using just five points

From: Roger Stafford

Date: 25 Jun, 2010 14:49:06

Message: 2 of 4

"S. Ali " <s.mirhadizadeh@ymail.com> wrote in message <i02en4$orh$1@fred.mathworks.com>...
> Hi,
> I want to draw an arc using just five points, would anyone help me in this case?
> also I need the equation of this fitted curve too.
>
> tnx
>
> ALI

  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?

Roger Stafford

Subject: draw an arc using just five points

From: S. Ali

Date: 25 Jun, 2010 15:07:19

Message: 3 of 4

"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <i02fl2$qie$1@fred.mathworks.com>...
> "S. Ali " <s.mirhadizadeh@ymail.com> wrote in message <i02en4$orh$1@fred.mathworks.com>...
> > Hi,
> > I want to draw an arc using just five points, would anyone help me in this case?
> > also I need the equation of this fitted curve too.
> >
> > tnx
> >
> > ALI
>
> 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?
>
> Roger Stafford


well ,I will try them, and see how its going to look like,
something like not whole Ellipse ,maybe just part of it.

Regards

ALI

Subject: draw an arc using just five points

From: Roger Stafford

Date: 25 Jun, 2010 21:02:23

Message: 4 of 4

"S. Ali " <s.mirhadizadeh@ymail.com> wrote in message <i02gn7$6bu$1@fred.mathworks.com>...
> well ,I will try them, and see how its going to look like,
> something like not whole Ellipse ,maybe just part of it.
> Regards
> ALI

  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:

 [U,S,V] = svd([x.^2,x.*y,y.^2,x,y,ones(size(x))]);
 a = V(1,6); b = V(2,6); c = V(3,6);
 d = V(4,6); e = V(5,6); f = V(6,6);

These last will be the coefficients of the conic section that contains the five points:

 a*x.^2 + b*x.*y + c*y.^2 + d*x + e*y + f = 0

You can use ezplot to display this conic section.

  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.

  Also note that if you have more than five points, this procedure finds the best-fitting conic section to the points in a least squares sense.

Roger Stafford

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us