POV-Ray : Newsgroups : povray.programming : information about splines : Re: information about splines Server Time
30 Jun 2024 12:07:15 EDT (-0400)
  Re: information about splines  
From: Thies Heidecke
Date: 10 Jun 2004 17:19:11
Message: <40c8d04f@news.povray.org>
> 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


 

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.