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
0
votes
0 answers

Discrepancy in Cubic Spline Interpolation, R & matlab

I am trying to replicate the spline() function in matlab using the spline() function in R's splinefun {stat}s package, without having full access to matlab (I don't have a licence for it). I am able to input all of the necessary data into R that…
Matt K.
  • 33
  • 1
  • 5
0
votes
1 answer

spline curve with steady transition in three js

I am drawing a CubicBezierCurve3 curve in three js. However, I would like it to be drawn part-by-part with a steady transition, instead of the entire curve being drawn at once. You may visualize it as a moving rocket leaving behind a gas trail. My…
tubby
  • 2,074
  • 3
  • 33
  • 55
0
votes
0 answers

how to generate natural spline in matlab?

I noticed that there are only not-a-knot and clamped spline in Matlab, which is assembled in the function spline. Can we change the original code in matlab a little bit so it can perform (or only perform) natural spline? I felt like it is a easy…
0
votes
1 answer

Issue with rendering b-spline animation in javascript

I've written a function that calculates the points for a b-spline curve, drawing the curve on the screen as the points are generated using the built in setinterval() function. The problem is that when these points are drawn to the screen, there is…
loremIpsum1771
  • 2,497
  • 5
  • 40
  • 87
0
votes
2 answers

1D Hermite Cubic Splines with tangents of zero - how to make it look smoother

I am given 3 values y0, y1, y2. They are supposed to be evenly spaced, say x0 = -0.5, x1 = 0.5, x2 = 1.5. And to be able to draw a spline through all of them, the derivatives at all points are said to be dy/dx = 0. Now the result of rendering two…
St0fF
  • 1,553
  • 12
  • 22
0
votes
1 answer

interpolation using cubic spline

#plotted log values of Re and C(d) import numpy as np import matplotlib.pyplot as plt plt.plot([np.log(0.2),np.log(2), np.log(20), np.log(200), np.log(2000), np.log(20000)], [np.log(103), np.log(13.9), np.log(2.72), np.log(0.800), np.log(0.401),…
darren
  • 47
  • 1
  • 9
0
votes
1 answer

Cubic spline / curve fitting

I need to determine parameters of Illumintaion change, which is defined by this continuous piece-wise polynomial C(t), where f(t) is is a cubic curve defined by the two boundary points (t1,c) and (t2,0), also f'(t1)=0 and f'(t2)=0. Original Paper:…
mrgloom
  • 20,061
  • 36
  • 171
  • 301
0
votes
1 answer

Why B-Spline are defined only where basis function sum to 1?

I'm trying to understand b-spline. It's not clear why << The curve is defined only where order basis functions overlap>>, where order is degree+1 (for a cubic the order is 4). I found also that where a number equal to the order of basis functions…
0
votes
1 answer

Spline normal in a given point

I've used the code avaiable at this link to implement the Cubic Spline Interpolation: http://www.codeproject.com/Articles/560163/Csharp-Cubic-Spline-Interpolation For each point in the spline I need to find the spline normal at that point. Does…
Martina
  • 791
  • 1
  • 14
  • 26
0
votes
1 answer

Spline Interpolation Matlab

I have the following: x = 1:365; y = T; xx = missing; yy = spline(x,y,xx) I have data T, which is 365 days of data, and missing is a vector containing the days on which the data is faulty. I need to generate estimated values at the missing days.…
Nylo
  • 3
  • 1
0
votes
1 answer

Spline cubic with tridiagonal matrix

I wrote this code for my homework on MATLAB about cubic spline interpolation with a tridiagonal matrix. I follow all the steps of the algorithm and I really don't find my error. The code it's ok with second grade functions but when I put, for…
marks
  • 31
  • 9
0
votes
2 answers

interpolate.splrep error: 'knots must be given for task =-1'

I'm trying to find a least squared cubic spline fit of data using the following code: from scipy import interpolate plt.subplot(223) l_hits = np.array(l_hits) list1 = np.log(l_hits) knots = list1.sort() xnew = np.arange(min(l_bins), max(l_bins)) tck…
user2954167
  • 155
  • 1
  • 3
  • 14
0
votes
2 answers

R - group_by utilizing splinefun

I am trying to group my data by Year and CountyID then use splinefun (cubic spline interpolation) on the subset data. I am open to ideas, however the splinefun is a must and cannot be changed. Here is the code I am trying to use: age <- seq(from =…
j riot
  • 544
  • 3
  • 6
  • 16
0
votes
1 answer

Sort cubic bezier splines around a point by outgoing tangent

I need to sort cubic bezier splines around a point by their outgoing tangent. My first attempt was to determine the outgoing tangent angle and sort by that. For a spline with four points p0, p1, p2, p3, the outgoing tangent angle is: p0 != p1 ?…
constexpr
  • 1,021
  • 10
  • 7
0
votes
1 answer

How can you plot a cubic fitting with the mean and standard deviation on the same graph?

I am trying to plot the mean, standard deviation and a cubic fitting on the same graph. At the moment, I use the 'errorbar' function to plot the mean and standard deviation. I use the fit function to get a cubic fitting on my data. How can I display…
1 2 3
11
12