Spline icon indicating copy to clipboard operation
Spline copied to clipboard

Similar Results to CubicSpline from scipy + eval_ddf

Open JadTawil-theonly opened this issue 4 years ago • 2 comments

I am trying to replicate the results with CubicSpline from scipy, but fail to do so :s, have you compared your implementation with theirs?

Also, Would you be able to add a eval_ddf method, for evaluating the acceleration of the spline as well?

JadTawil-theonly avatar Dec 26 '20 15:12 JadTawil-theonly

I am trying to replicate the results with CubicSpline from scipy, but fail to do so :s, have you compared your implementation with theirs?

Also, Would you be able to add a eval_ddf method, for evaluating the acceleration of the spline as well?

How different are they?

ziyuang avatar May 08 '23 21:05 ziyuang

Cubic Bézier are a specific case of B-splines. My code will give different behaviors whenever you change the order 'k' or the node type, that's expected.

A Cubic Bézier is a degree 3 curve with 4 control points. A B-Spline that reproduce it should have 4 control points as well (not less, not more) and an order of k=4 (degree of a B-Spline = k-1) The knot vector should be open uniform ranging from [0 - 1].

ddf is the acceleration, so by definition the difference of velocities, so one way to compute it numerically: eval_ddf(t) = ( eval_df( t + h ) - eval_df( t - h ) ) / 2*h

I don't recall the analytical evaluation though so I'll look it up later.

brainexcerpts avatar May 16 '23 23:05 brainexcerpts