Smooth trajectories, precise motion â one library. InterpolatePy brings together classic and modern interpolation techniques for robotics, animation, and scientific computing in a single, easyâtoâuse Python package.
If InterpolatePy saves you time or powers your research, please consider starring the repo â it helps others discover the project and motivates future development!
Have you built something cool on top of InterpolatePy? Open an issue or start a discussion â weâd love to showcase community projects.
InterpolatePy is a comprehensive collection of trajectoryâgeneration algorithms â from simple linear blends to highâorder Bâsplines â with a consistent, NumPyâfriendly API. Designed for robotics, animation, path planning, and data smoothing, it lets you craft trajectories that respect position, velocity, acceleration and jerk constraints.
Key design goals:
- Breadth â one package for splines and motion profiles.
- Visualizationâready â every spline exposes
plot()
helpers built on Matplotlib. - Pure Python âĽâŻ3.10 â no compiled extensions; installs quickly everywhere.
Upcoming features (â Â done, đ§Â planned):
Status | Feature |
---|---|
đ§ | Bezier curves â arbitrary degree |
đ§ | Quaternion interpolation: LERP / SLERP / SQUAD & Bâsplineâquaternions |
đ§ | Linear blends with quintic/parabolic smoothing |
đ§ | Spherical paths & greatâcircle splines |
- BâSplines â cubic, approximating, smoothing.
- Cubic Splines â with optional velocity/acceleration endpoint constraints.
- Global BâSpline Interpolation â C², CÂł, Câ´ continuity (degree 3â5).
- DoubleâS (Sâcurve) â bounded jerk.
- Trapezoidal â classic industrial profile.
- Polynomial â 3/5/7âorder with boundary conditions.
- Linear & Circular paths in 3âD.
- Frenet frames helper for tool orientation along curves.
InterpolatePy lives on PyPI. Install the latest stable release with:
pip install InterpolatePy
Development version (with test & dev extras):
git clone https://github.com/GiorgioMedico/InterpolatePy.git
cd InterpolatePy
pip install -e '.[all]'
Optional extras:
pip install InterpolatePy[test] # testing only
pip install InterpolatePy[dev] # linting & build tools
from interpolatepy.cubic_spline import CubicSpline
t = [0, 5, 10]
q = [0, 2, 0]
spline = CubicSpline(t, q, v0=0.0, vn=0.0)
print(spline.evaluate(7.5)) # position at t = 7.5Â s
spline.plot() # visualize position/velocity/acceleration
Cubic spline with velocity constraints
from interpolatepy.cubic_spline import CubicSpline
t_points = [0.0, 5.0, 7.0, 10.0]
q_points = [1.0, 3.0, -1.0, 2.0]
s = CubicSpline(t_points, q_points, v0=1.0, vn=0.0)
position = s.evaluate(6.0)
DoubleâS trajectory
from interpolatepy.double_s import DoubleSTrajectory, StateParams, TrajectoryBounds
state = StateParams(q_0=0, q_1=10, v_0=0, v_1=0)
bounds = TrajectoryBounds(v_bound=5, a_bound=10, j_bound=30)
traj = DoubleSTrajectory(state, bounds)
For more, see the examples folder or the full API docs (coming soon).
- Python âĽâŻ3.10
- NumPy âĽâŻ2.0
- SciPy âĽâŻ1.15
- Matplotlib âĽâŻ3.10
InterpolatePy uses modern Python tooling for development:
- Code Quality: Black and isort for formatting, Ruff and mypy for linting and type checking
- Testing: pytest for unit tests and benchmarks
To set up the development environment:
pip install -e '.[all]'
pre-commit install
python -m pytest tests
We love pull requests â thanks for helping improve InterpolatePy!
-
Fork the repository and create a descriptive branch (
feat/my-feature
). -
Install dev dependencies:
pip install -e '.[all]' pre-commit install
-
Code your change, following our style (Black, isort, Ruff, mypy).
-
Test with
pytest
and runpre-commit run --all-files
. -
Open a pull request and explain why & how your change helps.
For larger ideas, open an issue first so we can discuss direction and scope.
InterpolatePy implements algorithms and mathematical concepts primarily from the following authoritative textbooks:
- Biagiotti, L., & Melchiorri, C. (2008). Trajectory Planning for Automatic Machines and Robots. Springer.
- Siciliano, B., Sciavicco, L., Villani, L., & Oriolo, G. (2010). Robotics: Modelling, Planning and Control. Springer.
The library's implementation draws heavily from the theoretical frameworks, mathematical formulations, and algorithms presented in these works.
I express my gratitude to these authors for their significant contributions to the field of trajectory planning and robotics, which have made this library possible.
InterpolatePy is released under the MIT License â do whatever you want, but please give credit.
If InterpolatePy contributes to your academic work, consider citing it:
@misc{InterpolatePy,
author = {Giorgio Medico},
title = {InterpolatePy: Trajectory and Spline Library},
year = {2025},
howpublished = {\url{https://github.com/GiorgioMedico/InterpolatePy}}
}