"tools/python/vscode:/vscode.git/clone" did not exist on "4b6087f748eb0fafcac6f1af0e06aec99d6cc5c1"
Commit 40da8bf7 authored by Davis King's avatar Davis King
Browse files

Added length() for point and dpoint in the Python API.

parent 52e7ab68
......@@ -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"));
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment