Questions tagged [cubic-spline]

A cubic spline is a smooth 3-order polynomial function that is piecewise-defined, and possesses a high degree of smoothness at the knots where the polynomial pieces connect.

A cubic spline is a smooth 3-order polynomial function that is piecewise-defined, and possesses a high degree of smoothness at the knots where the polynomial pieces connect. The most common cubic splines are Hermite, B-splines and Bezier splines.

Further details can be found at the sites below:

  1. wikipedia
  2. mathematica
170 questions
2
votes
1 answer

fmin_slsqp returns initial guess finding the minimum of cubic spline

I am trying to find the minimum of a natural cubic spline. I have written the following code to find the natural cubic spline. (I have been given test data and have confirmed this method is correct.) Now I can not figure out how to find the minimum…
Thomas Mc Donald
  • 407
  • 1
  • 5
  • 11
2
votes
0 answers

Convert a degree 3 cubic Nurbs Curve to Catmull-Rom?

Is there a way to convert a degree 3 cubic Nurbs curve to a Catmull-Rom curve? The Nurbs curve has a standard knot vector, so for example a curve with 10 control points has these 12 knots: [ 0 0 0 1 2 3 4 5 6 7 7 7 ] I assume the resulting…
Daniela
  • 169
  • 2
  • 5
2
votes
1 answer

How to show "smooth csplines" curve on plot with right-to-left x-axis in Gnuplot

I have this simple self-contained gnuplot script: set terminal png size 400,300 set output 'test.png' unset key set xrange [30:50] $data << EOD 42, 5.7 44, 8.1 46, 8.9 48, 9.2 50, 9.3 EOD plot "$data" using 1:2 smooth csplines, \ "$data"…
smls
  • 5,738
  • 24
  • 29
2
votes
1 answer

Spline Normal Calculation

I am having a issue calculating the normal of a spline to extrude a mesh from. Check the Image : As you can see, the normals in a certain area apear flipped, and I have no idea why. Relevant Code : public Vector3 GetNormal(float t) { …
Morphex
  • 306
  • 3
  • 15
2
votes
1 answer

Calculate time t along a 2D cubic bezier equal to a given tangent vector

I have a cubic bezier defined by four points. I need to find the time t along the cubic bezier where the tangent is equal to a given vector. This problem is not as straightforward as it may seem on first glance. I'll explain the basic math first for…
Sirisian
  • 417
  • 6
  • 21
2
votes
0 answers

How does one calculate the smoothing condition used in python's interpolate.splrep?

I'm attempting to fit a cubic spline to a time-series using scipy's interpolate.splrep. However, I can't work out how to determine a valid smoothing condition without manually adjusting it by eye. It seems like there should be a way to calculate…
WillaB
  • 420
  • 5
  • 12
2
votes
1 answer

How to set first and last slope of cubic spline interpolation in scipy.interpolate?

I have a data set containing n two-dimensional points (x0,y0),(x1,y1), ... (xn-1,yn-1) where x0 < x1 < ... < xn-1. I want to interpolate this data set using cubic splines with explicit slope values SBEGIN and SEND set at both end points (x0,y0) and…
Izumi Kawashima
  • 1,197
  • 11
  • 25
2
votes
2 answers

Adding piecewise polynomials in MATLAB

I need to add piecewise polynomials derived from multiple datasets. Is there an easy way to add piecewise polynomials together without interpolating? In other words, given PP1 and PP2, is there a way to generate PP3 (where PP3 remains in a piecewise…
Delyle
  • 529
  • 3
  • 14
2
votes
2 answers

Why does InterpolatedUnivariateSpline return nan values

I have some data, y vs x, which I would like to interpolate at a finer resolution xx using a cubic spline. Here is my dataset: import numpy as np print np.version.version import scipy print scipy.version.version 1.9.2 0.15.1 x =…
jakebrinkmann
  • 704
  • 9
  • 23
2
votes
2 answers

Position(t) on cubic bezier curve

The only equation to calculate this that I can find involves t in the range [0, 1], but I have no idea how long it will take to travel the entire path, so I can't calculate (1 - t). I know the speed at which I'm traveling, but it seems to be a…
idlackage
  • 2,715
  • 8
  • 31
  • 52
1
vote
2 answers

What do the in- and out-tangents in glTF's cubic splines visually represent?

Keyframe animations in glTF support "cubic spline" interpolation, with the specification for them simply saying (with my added emphasis): Let: n be the total number of keyframes, n>0; tk be the timestamp of the k-th keyframe, k ∈ [1,n]; vk be the…
Phrogz
  • 296,393
  • 112
  • 651
  • 745
1
vote
0 answers

Cyclic/Seasonal cubic spline

I would like to fit a cubic spline to a time series that is seasonal i.e. integrating the day of the year in the independent variables. I have been looking at scipy and statsmodels but I have found no examples as to how to apply them when the data…
ric
  • 153
  • 8
1
vote
0 answers

prove continuity of cubic regression spline

How can I prove that the cubic regression spline y_i = α + K+4∑k=2 β_kh_k(x_i) + e_i is continuous in the first and second derivative at the knots? I understand how to prove the property by expanding the equation for f(x)=β0+β1x+β2x2+β3x3+β4(x−ξ)3+…
chacha2000
  • 11
  • 2
1
vote
0 answers

scipy interp2d implementation in C#

I need to interpolate a smooth surface from a 3D point cloud (z=f(x,y)) and I've found that scipy's interp2d function gives very satisfactory results, using cubic splines. Unfortunately, the software I'm working on is written in C# and it would be…
zdimension
  • 977
  • 1
  • 12
  • 33
1
vote
1 answer

Scipy Cubicspline vs Real Stats using Excel Spline

I'm currently running some interpolations (Cubic spline interpolations) on python and excel. Given limitations on how some of the data needs to be displayed and is obtained, I need to run a cubic spline interpolation on python for some data and…
joel.tan
  • 41
  • 5
1 2
3
11 12