splinebox.multivariate.MultivariateSpline.

__call__#

MultivariateSpline.__call__(t, derivatives=0)#

Evaluate the multivariate spline at the parameter values t.

Parameters:
tnumpy array

Array of shape (..., nvariate) containing one parameter value per variable.

derivativesint or iterable of int

Derivative order for each variable. A single integer is broadcast to all variables.

Returns:
numpy array

Spline values of shape (..., ndim).

Raises:
ValueError

If t.shape[-1] does not match nvariate or if the length of derivatives does not match nvariate.

Examples

>>> import numpy as np
>>> import splinebox
>>> spline = splinebox.multivariate.MultivariateSpline(
...     M=(4, 4),
...     basis_functions=splinebox.B3(),
...     closed=(True, True),
... )
>>> spline.control_points = np.random.rand(4, 4, 2)
>>> t0 = np.linspace(0, 4, 5)
>>> t1 = np.linspace(0, 4, 5)
>>> t = np.stack(np.meshgrid(t0, t1, indexing="ij"), axis=-1)
>>> values = spline(t)