Skip to content
Snippets Groups Projects
Commit a1d9c6f5 authored by Steve Tonneau's avatar Steve Tonneau
Browse files

added python bindings for derivative

parent 3005c737
No related branches found
No related tags found
No related merge requests found
...@@ -159,6 +159,8 @@ BOOST_PYTHON_MODULE(spline) ...@@ -159,6 +159,8 @@ BOOST_PYTHON_MODULE(spline)
.def("min", &bezier_t::min) .def("min", &bezier_t::min)
.def("max", &bezier_t::max) .def("max", &bezier_t::max)
.def("__call__", &bezier_t::operator()) .def("__call__", &bezier_t::operator())
.def("derivate", &bezier_t::derivate)
.def("compute_derivate", &bezier_t::compute_derivate)
; ;
/** END bezier curve**/ /** END bezier curve**/
......
...@@ -11,6 +11,10 @@ a = bezier(waypoints, -1., 3.) ...@@ -11,6 +11,10 @@ a = bezier(waypoints, -1., 3.)
a.min() a.min()
a.max() a.max()
a(0.4) a(0.4)
assert((a.derivate(0.4,0) == a(0.4)).all())
a.derivate(0.4,2)
a = a.compute_derivate(100)
#testing spline function #testing spline function
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment