| 570 | } |
| 571 | |
| 572 | PyObject* VectorPy::distanceToPoint(PyObject* args) const |
| 573 | { |
| 574 | PyObject* pnt = nullptr; |
| 575 | if (!PyArg_ParseTuple(args, "O!", &(VectorPy::Type), &pnt)) { |
| 576 | return nullptr; |
| 577 | } |
| 578 | |
| 579 | VectorPy* base_vec = static_cast<VectorPy*>(pnt); |
| 580 | VectorPy::PointerType this_ptr = getVectorPtr(); |
| 581 | VectorPy::PointerType base_ptr = base_vec->getVectorPtr(); |
| 582 | |
| 583 | Py::Float dist(Distance(*this_ptr, *base_ptr)); |
| 584 | return Py::new_reference_to(dist); |
| 585 | } |
| 586 | |
| 587 | PyObject* VectorPy::distanceToLine(PyObject* args) const |
| 588 | { |