Skip to content

Instantly share code, notes, and snippets.

@AlexEshoo
Created August 30, 2018 15:30
Show Gist options
  • Save AlexEshoo/1cb9d15f220fd35f519b9b7ebe1676f3 to your computer and use it in GitHub Desktop.
Save AlexEshoo/1cb9d15f220fd35f519b9b7ebe1676f3 to your computer and use it in GitHub Desktop.
Parametric Spline path
from matplotlib import pyplot as plt
import numpy as np
from scipy.interpolate import interp1d
t = np.linspace(0, 10, 5)
x = np.array([0, 2, 3, 10, 15])
y = np.array([0, 1, 2, 8, 15])
f = interp1d(x,y, kind='cubic')
plt.plot(np.linspace(0,15,1000), f(np.linspace(0,15,1000)))
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment