Article 6XP0K Fitting a parabola to an ellipse and vice versa

Fitting a parabola to an ellipse and vice versa

by
John
from John D. Cook on (#6XP0K)

The previous post discussed fitting an ellipse and a parabola to the same data. Both fit well, but the ellipse fit a little better. This will often be the case because an ellipse has one more degree of freedom than a parabola.

There is one way to fit a parabola to an ellipse at an extreme point: match the end points and the curvatures. This uses up all the degrees of freedom in the parabola.

When you take the analogous approach to fitting an ellipse to a parabola, you have one degree of freedom left over. The curvature depends on a ratio, and so you can adjust the parameters while maintaining the ratio. You can use this freedom to fit the parabola better over an interval while still matching the curvature at the vertex.

The rest of the post will illustrate the ideas outlined above.

Fitting a parabola to an ellipse

Suppose you have an ellipse with equation

(x/a)^2 + (y/b)^2 = 1.

The curvature at (a, 0) equals a/b^2 and the curvature at (0, b) equals b/a^2.

Now if you have a parabola

x =cy^2 + d

then its curvature aty = 0 is 2|c|.

If you want to match the parabola and the ellipse at (a, 0) thend =a.

To match the curvatures at (a, 0) we set a/b^2 = 2|c|. Soc = -a/2b^2. (Without the negative sign the curvatures would match, but the parabola would turn away from the ellipse.)

Similarly, at (-a, 0) we haved = -a and c = a/2b^2. And at (0, b) we haved = b andc = b/2a^2.

Here's an example witha golden ellipse.

parabola_ellipse1.png

Fitting an ellipse to a parabola

Now we fix the parabola, say

y =cx^2

and find an ellipse

(x/a)^2 + ((y - y0)/b)^2 = 1

to fit at the vertex (0, 0). For the ellipse to touch the parabola at its vertex we must have

((0 - y0)/b)^2 = 1

and so y0 =b. To match curvature we have

b/2a^2 = c.

Soa andb are not uniquely determined, only the ratio b/a^2. As long as this ratio stays fixed at 2c, every ellipse will touch at the vertex and match curvature there. But larger values of the parameters will match the parabola more closely over a wider range. In the limit asb (keeping b/a^2 = 2c), the ellipses become a parabola.

parabola_ellipse2.png

Related postsThe post Fitting a parabola to an ellipse and vice versa first appeared on John D. Cook.
External Content
Source RSS or Atom Feed
Feed Location http://feeds.feedburner.com/TheEndeavour?format=xml
Feed Title John D. Cook
Feed Link https://www.johndcook.com/blog
Reply 0 comments