<< CL_gcd Math CL_integrate >>

celestlab >> Math > CL_hermiteFitPoly

CL_hermiteFitPoly

Hermite polynomial

Calling Sequence

[p, pdot, p2dot] = CL_hermiteFitPoly(xref, yref, ydotref)

Description

Parameters

xref:

Reference abscissae. (PxN)

yref:

Corresponding ordinates. (PxN)

ydotref:

Corresponding derivatives. (PxN)

p:

Hermite polynomials. (1xN)

pdot:

First derivative of the polynomials. (1xN)

p2dot:

Second derivative of the polynomials. (1xN)

Authors

See also

Examples

// 1) Generate a polynomial (degree <= 5)
xref = [-0.5; 0; 0.5];
yref = [1; 2; 3];
ydotref = [3; 2; 1];
[p, pdot] = CL_hermiteFitPoly(xref, yref, ydotref)

// Check results
horner(p, xref) // => yref
horner(pdot, xref) // => ydotref

// 2) Vectorized form (use previous result)
xref = [[-0.5; 0; 0.5], [0; 0.5; 1]];
yref = horner(p, xref);
ydotref = horner(pdot, xref);
p2 = CL_hermiteFitPoly(xref, yref, ydotref)

// Check results
p2 - [p,p] // => [0,0]

Report an issue
<< CL_gcd Math CL_integrate >>