Bsoft 2.1.4
Bernard's software package
spline.cpp File Reference

Functions to calculate spline curves. More...

#include "Matrix.h"
#include "utilities.h"

Functions

Vector3< double > vector3_catmull_rom_interpolate (Vector3< double > *pnt, double t)
 
Vector3< double > * vector3_catmull_rom_spline (long ncoord, Vector3< double > *coords, long &nspline)
 Calculates a 2D/3D spline curve using the Catmull-Rom algorithm. More...
 
double tps_base_func (double r)
 
vector< double > thin_plate_splines (vector< Vector3< double > > points, double lambda)
 
double tps_interpolate (Vector3< double > &loc, vector< Vector3< double > > points, vector< double > w)
 

Variables

int verbose
 

Detailed Description

Functions to calculate spline curves.

Author
Bernard Heymann
Date
Created: 20020808
Modified: 20151023

Function Documentation

◆ thin_plate_splines()

vector< double > thin_plate_splines ( vector< Vector3< double > >  points,
double  lambda 
)

◆ tps_base_func()

double tps_base_func ( double  r)

◆ tps_interpolate()

double tps_interpolate ( Vector3< double > &  loc,
vector< Vector3< double > >  points,
vector< double >  w 
)

◆ vector3_catmull_rom_interpolate()

Vector3< double > vector3_catmull_rom_interpolate ( Vector3< double > *  pnt,
double  t 
)

◆ vector3_catmull_rom_spline()

Vector3< double > * vector3_catmull_rom_spline ( long  ncoord,
Vector3< double > *  coords,
long &  nspline 
)

Calculates a 2D/3D spline curve using the Catmull-Rom algorithm.

Parameters
ncoordnumber of coordinates.
*coordsnode or point coordinates.
&nsplinepointer to number of values in spline curve.
Returns
Vector3<double>* spline curve.
A Catmull-Rom spline curve is defined for 4 points {p0,p1,p2,p3} by:
    spline = 0.5*(-t*(1-t)^2)*p0 + (2-5*t^2+3*t^3)*p1 +
             t*(1+4*t-3*t^2)*p2 - t^2*(1-t)*p3
where 0 <= t <= 1 is the fractional distance between points p1 and p2.
Each dimension is interpolated separately.
The end segments of the spline are defined as straight lines.

Variable Documentation

◆ verbose

int verbose
extern