POV-Ray : Newsgroups : povray.general : Cubic spline question : Re: Cubic spline question Server Time
19 Nov 2024 15:22:08 EST (-0500)
  Re: Cubic spline question  
From: Mark Wagner
Date: 17 Feb 2002 01:56:17
Message: <3c6f5411@news.povray.org>
Rune wrote in message <3c6e2f6e@news.povray.org>...
>"Mark Wagner" wrote:
>> The "all control points" method gives a spline that is
>> smooth along its entire length (essential for those
>> applications that require computing the second
>> derivative of the spline).
>
>That's probably a fine spline, but is it a cubic spline or a completely
>different type? To have different spline types go under the same name seem
>like a very bad thing to do. Is it official POV-Team policy to do that?

I am getting quite tired of repeatedly having to defend my decision on how
cubic splines work.  Rune, for the record, this is the third time I have
explained this to you.  This is the last time I will say this.  For the
record, here is what I have to say on the matter:

Cubic splines are a *very* *broad* *class* of splines.  The type I have
chosen to code in the spline{} functionality of POV-Ray are the natural
cubic splines.

From _Numerical Mathematics and Computing, Fourth Edition_, by Ward Cheney
and David Kincaid, a natural cubic spline is one where:

1) The function is constructed from a number of cubic polynomial pieces
2) The function is continuous
3) The first derivative of the function is continuous
4) The second derivative of the function is continuous
5) The function passes through all control points
6) The second derivative of the function is zero at the first and last
control points

For cubic splines in general, the first four conditions hold.

_Applied Numerical Methods_, by Brice Carnahan, H. A. Luther, and James
Wilkes agrees with these definitions.

These are the two textbooks I used in developing the cubic splines used in
the spline{} code.

From my experiments with producing a cubic spline by fitting a cubic
polynomial to each set of four control points, the resulting curve is
continuous and passes through all control points, but does not have
continuous first or second derivatives, and so is not a cubic spline of any
sort.  Rune, if you'll look at the image you attached to the post "Yet
another spline bug", posted on 8/29/01 in the povray.pre-beta.binaries
group, you'll see what happens when you produce a curve by this method.
From looking at the code for the prism object, it appears that this is the
method used by that object.

Rune, if you want a different behavior for cubic splines, please code it
yourself.

--
Mark


Post a reply to this message

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