Bounding the error of Ellipse approximation by a cubic Spline

103 Views Asked by At

So situation is like this. I have an Ellipse $(a cos(t), bsin(t))$. My final goal was to approximate it by a cubic spline it such a way that modulus of velocity along a curve is approximately a constant. This is what I did for the first quarter of ellipse (the full ellipse will follow from symmetry):

  1. Approximated Ellipse with circular arcs using this.
  2. Now,for each Arc: a line that connects the center of corresponding circle with some point at the arc at time $t$ also crosses some point $(x, y)$ of the ellipse. Those coordinates as a function of t then has an explicit function: $x(t)=\frac{A(t)a^2\cdot(A(t)c - d) - ab\sqrt{A(t)^2a^2 - (A(t)c - d)^2 + b^2}}{(A(t)^2a^2 + b^2)}$, where $A(t) = \tan(kt+const)$ and the rest are constants

And the equation y(t) follows from $\frac{x^2}{a^2}+\frac{y^2}{b^2}=1$

  1. Thus, joining those pieces together, I now have two piecewise continuous functions $x(t), y(t)$ whose plots (for $a=8$ and $b=3$)I show bellow. At any given $t$, $(x(t), y(t))$ is on the ellipse, furthermore, the modulus of velocity of the parametric curve defined in this way is very close to constant.

Plot of the piecewise function for quarter of the ellipse Plot of its derivatives

  1. Having these functions, now I want to perform cubic spline on them, since I need to have the result in cubic polynomial functions.

Now I have the two following questions:

  • What could be the smart way to chose the sample points for the Spline?
  • Having chosen the points, how can I evaluate the error between the Spline and the original Ellipse (or the functions $x(t), y(t)$)? If the error is bigger than what I want, how could I efficiently resample the points?

I read that for a spline, the error is bounded by forth derivative of the original function. For now I think this is the best way, so unless anybody has any other suggestions, the more simple questions would be, how to bound $x(t)^{(4)}$ the forth derivative of the function defined above?

Thank you very much for your answers and help

1

There are 1 best solutions below

0
On

Your approach so far looks good.

For a cubic spline interpolant, the error is indeed bounded by a constant times the fourth derivative of the function you’re approximating.

But I’d suggest a divide-and-conquer approach, instead. Start by approximating the ellipse quadrant by a single cubic segment. Measure the error. I think you want to approximate the unit-speed function $f$, not the ellipse. I’d suggest just taking some sample points along the cubic, and measuring their distance to the corresponding points on $f$. I’d say around 10 points would adequate. If the error is too large. Divide the curve at the point where the error is greatest, and then apply your approximation algorithm to the two pieces. Continue until you reach the desired tolerance.

You probably should not use classical cubic spline interpolation. You know the derivatives of the curve you’re approximating, so you should use them. Look up Hermite interpolation, or read the answer here.