mirror of https://github.com/davisking/dlib.git
Added length() for point and dpoint in the Python API.
This commit is contained in:
parent
52e7ab68bc
commit
40da8bf72f
|
@ -216,4 +216,9 @@ void bind_vector(py::module& m)
|
|||
.def("extend", extend_vector_with_python_list<dpoint>)
|
||||
.def(py::pickle(&getstate<type>, &setstate<type>));
|
||||
}
|
||||
|
||||
m.def("length", [](const point& p){return length(p); },
|
||||
"returns the distance from p to the origin, i.e. the L2 norm of p.", py::arg("p"));
|
||||
m.def("length", [](const dpoint& p){return length(p); },
|
||||
"returns the distance from p to the origin, i.e. the L2 norm of p.", py::arg("p"));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue