Re: Cubic Spline in parametric form



The functions 'spline' and 'pchip' are available in the bae MATLAB
product which will provide the coefficients of the spline polynomial,
but using the original abscissae. For example:

X = [1 2 3 4]; % abscissae
Y = [2 5 7 9]; % ordinates
S = spline(X,Y)

S =

form: 'pp'
breaks: [1 2 3 4]
coefs: [3x4 double]
pieces: 3
order: 4
dim: 1

S.coefs

ans =

0.1667 -1.0000 3.8333 2.0000
0.1667 -0.5000 2.3333 5.0000
0.1667 0 1.8333 7.0000


The values in S.coefs are the spline polynomial coefficients, but the
polynomial in the middle segment, for instance, operates on values from
2 to 3.


-Will Dwinnell
http://will.dwinnell.com



Nik Syahrim wrote:
Here is my problem.

I need to connect points with cubic splines. For example, four points
connected with three splines.
The equations of the cubic spline is defined in function of t
(parametric equation)

like this:

x(t) = (a3)t^3 + (a2)t^2 + (a1)t + a0
y(t) = (b3)t^3 + (b2)t^2 + (b1)t + b0

t= [1..0] (t varies from 1 to 0 for each spline.)

What I need are the coefficients of the parametric equations, (a3,
a2, a1, b3, b2 and b1)

.



Relevant Pages

  • Re: Derivative of splinefit w.r.t. control points.
    ... >Dear Peter, ... >I use a natural cubic spline. ... the toolbox as a black box and compute those derivatives numerically. ... the coefficients are given by a strucutre and you must access a component of the ...
    (sci.math.num-analysis)
  • Re: FORTRAN TYPE construct?
    ... I am in fact using the F77 SPLINE and SPLINT. ... correct values in the arrays, ... So make sure that you allocate enough space to hold these coefficients ...
    (comp.lang.fortran)
  • Re: Derivative of splinefit w.r.t. control points.
    ... > don't have direct access to the equations. ... I don't have Matlab, but Mathematica. ... all the "equations" variables are the 4th item in the Spline ... >> by evaluating the representation with the new coefficients instead of the ...
    (sci.math.num-analysis)
  • Re: Derivative of splinefit w.r.t. control points.
    ... >I'm working on an optimization problem using splines. ... >Say that I've a cubic natural spline f. ... >Is it possible to determine the derivative of the fit in a certain evaluation point analytically. ... then you will get the derivative of the splines' coefficients with respect to ...
    (sci.math.num-analysis)

Loading