|
![](/i/fill.gif) |
> Hi,
Hi
> I would know a little bit much about how povray compute splines, and what
> mathematical method of interpolation is used. I have looked to the
> documentation, but I just have found there how to use them. Is there a
> most accurate ressource (doc, article) about that?
> It is to do a simple program to visualize spline.
> Thanks,
> Demaeyer Jonathan
This sums it up in pretty short words(with applet):
http://www.math.utah.edu/~wright/applets/spline/spline.html
or a bit better explained:
http://mathworld.wolfram.com/CubicSpline.html
The idea with splines is to have a number of controlpoints for which you
specify the position (x-coordinate) and the value (y-position). Now
you compute a cubic polynomial for each interval between two neighbouring
controlpoints. More precisely, you compute the cubic polys so that they
make a continuous function where they meet. Furthermore you demand the
same continuity for the first and second derivative. Since the polys
are cubics, the first derivative is a quadratic function and the second
derivative is linear. But they still are continuous. The third der.
is just a constant in each interval and all from the 4th der. up are zero.
I've attached(sorry in advance for doing that in a non-binary group)
a little picture showing an example spline with 6 controlpoints and 5
intervals. The spline itself is shown in blue, the 1st der. in red,
the 2nd der. in green and the 3rd in yellow.
The process of getting the coefficients is explained on the wolframpage.
Basically, you have to solve a linear equation system which is given by
your continuity-constraints for the function and the derivatives.
I hope this helps a bit,
Thies
Post a reply to this message
Attachments:
Download 'Cubic-Spline-Example.png' (8 KB)
Preview of image 'Cubic-Spline-Example.png'
![Cubic-Spline-Example.png](/povray.programming/attachment/%3C40c8d04f%40news.povray.org%3E/Cubic-Spline-Example.png?preview=1)
|
![](/i/fill.gif) |