'Get Trajectory of Three Dimensional Cubic Spline Scipy
I am trying to approximate a given route (coordinates) with a three dimensional cubic spline. Example data:
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import axes3d
import numpy as np
%matplotlib inline
x = np.array([1, 2, 2.3, 3, 4, 5, 5.5, 8, 9, 9.5])
y = np.arange(0, 10)
z = np.sin(x) * np.cos(y^2) + x
fig = plt.figure(figsize=(10,6))
ax = axes3d.Axes3D(fig)
ax.stem(x, y, z)
I now approximate the data points with RBF Interpolator from scipy. Is this the right approach?
from scipy.interpolate import RBFInterpolator
coord_data = np.stack([x, y], -1)
spline = RBFInterpolator(coord_data, z, kernel = 'cubic')
How do I get the resulting spline now (the points it is following through)? And how do I access it's derivatives?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

