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:
Ellipse plot

Subject: Ellipse plot

From: Isadora

Date: 1 Jun, 2011 01:37:02

Message: 1 of 4

Hi so I was wondering how you would go about plotting an ellipse on matlab, but I want it to have nodes at set intervals around the ellipse that I would be able to control.
What I have right now is a bunch of nodes that I have connected by straight lines imitating an ellipse, but I would like to have smooth lines and evenly spaced nodes. How would I be able to do that?
Thanks

Subject: Ellipse plot

From: TideMan

Date: 1 Jun, 2011 02:06:44

Message: 2 of 4

On Jun 1, 1:37 pm, "Isadora " <ical1...@gmail.com> wrote:
> Hi so I was wondering how you would go about plotting an ellipse on matlab, but I want it to have nodes at set intervals around the ellipse that I would be able to control.
> What I have right now is a bunch of nodes that I have connected by straight lines imitating an ellipse, but I would like to have smooth lines and evenly spaced nodes. How would I be able to do that?
> Thanks

Show us what you've got now, then.
If you've done it correctly, you should simply be able to increase the
number of angular increments around the 360 deg. to get a smoother
curve.

Subject: Ellipse plot

From: Roger Stafford

Date: 1 Jun, 2011 02:25:14

Message: 3 of 4

"Isa" wrote in message <is453u$sno$1@newscl01ah.mathworks.com>...
> Hi so I was wondering how you would go about plotting an ellipse on matlab, but I want it to have nodes at set intervals around the ellipse that I would be able to control.
> What I have right now is a bunch of nodes that I have connected by straight lines imitating an ellipse, but I would like to have smooth lines and evenly spaced nodes. How would I be able to do that?
> Thanks
- - - - - - - - -
  It is easy make a plot of an ellipse. Surprisingly it is not so easy to place precisely evenly-spaced points around its circumference. This problem is I believe the source of the name "elliptic integrals". The total arclength requires the solution of an elliptic integral of the second kind, complete. The arclength to arbitrary points on it requires an elliptic integral of the second kind, incomplete.

  You can read about it at the Wikipedia site:

http://en.wikipedia.org/wiki/Elliptic_integral

  Matlab's Symbolic Toolbox contains a MuPAD function called 'EllipticE' that can solve such problems. Read about it at:

 http://www.mathworks.com/help/toolbox/symbolic/mfunlist.html

Roger Stafford

Subject: Ellipse plot

From: ImageAnalyst

Date: 1 Jun, 2011 02:33:39

Message: 4 of 4

Isadora:
You might try John D'Errico's interparc:

http://www.mathworks.com/matlabcentral/fileexchange/27096-interparc

Description

I've occasionally gotten requests for the ability to interpolate a 2-d
curve (or a general space curve) as a function of arc length,
returning points that are now equally spaced in arc length, where
originally the points had an arbitrary spacing.

This is a simple thing to do if you are willing to use a piecewise
linear interpolant. More difficult is when the curve is a parametric
spline or pchip model. The interparc.m function uses an ode solver to
integrate the distance along the curve itself, then uses that ode
solver to do the interpolation.

For example, generate a set of unequally spaced points around the
perimeter of a unit circle.


etc. . . . . . .

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