POV-Ray : Newsgroups : povray.advanced-users : Some math aid required... : Re: Some math aid required... Server Time
29 Jul 2024 02:26:21 EDT (-0400)
  Re: Some math aid required...  
From: Christopher James Huff
Date: 10 Feb 2004 16:17:44
Message: <cjameshuff-F597F7.16180510022004@news.povray.org>
In article <40294052$1@news.povray.org>,
 "Tim Nikias v2.0" <tim.nikias (@) nolights.de> wrote:

> It works, now that I've cleaned the code and found some stupid mistakes I
> made... As I understand it, instead of interpolating between four points
> with a cubic, I interpolate with three points with a squared function.

Well, yes, the derivative of the cubic spline is a quadratic function. 
It doesn't interpolate between those three points though...its value at 
one of those points is not the value of that point, it is the slope of 
the tangent line at that point. It appears to be something like a 
quadratic interpolation of the tangents formed by the control points...


> Ah, now I understood what you were aiming at. Yes, that should work, too.
> But honestly, that "shortcut", as you called it, looks nice and slick in
> code, whereas the "simplified" model looks pretty ugly. Unless... Taking a
> long shot here, but I guess you could adjust the formula so that it ends up
> looking like the one Sascha gave...

Again, that was only a simplified expression of the equation of the 
derivative. The term "simplified" has nothing to do with how simple it 
is compared to other solutions.


B0(t) = (1 - t)^2
B1(t) = 2*t*(1 - t)
B2(t) = t^2

n0 = p1 - p0
n1 = p2 - p1
n2 = p3 - p2

n(t) = n0*B0(t) + n1*B1(t) + n2*B2(t)
=
(p1 - p0)*(1 - t)^2 + (p2 - p1)*2*t*(1 - t) + (p3 - p2)*t^2

But this does not work at all...

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: <chr### [at] tagpovrayorg>
http://tag.povray.org/


Post a reply to this message

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