splinebox.spline_curves.Spline.
__call__#
- Spline.__call__(t, derivative=0)#
Evalute the spline or one of its derivatives at parameter value(s) t.
- Parameters:
- tnumpy.array, float
A 1D numpy array or a single float value.
- derivativeint
Can be 0, 1, 2 for the spline, and its first and second derivative respectively.
Examples
We start by creating a spline.
>>> spline = splinebox.Spline(M=4, basis_function=splinebox.B3(), closed=False) >>> spline.knots = np.array([[0, 0], [1, 1], [2, 0], [3, 1]])
We can use __call__ to evaluate the spline at a parameter position
>>> spline(2.3) array([2.349, 0.143])
Or we can evaluate it a multiple positions at once: >>> t = np.linspace(0, spline.M - 1, 3) >>> spline(t) array([[-0. , -0. ],
[ 1.5, 0.5], [ 3. , 1. ]])