| 582 | } |
| 583 | |
| 584 | PyObject* MatrixPy::rotateY(PyObject* args) |
| 585 | { |
| 586 | double angle = 0; |
| 587 | do { |
| 588 | PyObject* object {}; |
| 589 | if (PyArg_ParseTuple(args, "O!", &(QuantityPy::Type), &object)) { |
| 590 | Quantity* q = static_cast<QuantityPy*>(object)->getQuantityPtr(); |
| 591 | if (q->getUnit() == Unit::Angle) { |
| 592 | angle = q->getValueAs(Quantity::Radian); |
| 593 | break; |
| 594 | } |
| 595 | } |
| 596 | |
| 597 | PyErr_Clear(); |
| 598 | if (PyArg_ParseTuple(args, "d: angle to rotate (double) needed", &angle)) { |
| 599 | break; |
| 600 | } |
| 601 | |
| 602 | PyErr_SetString(PyExc_TypeError, "For angle either float or Quantity expected"); |
| 603 | return nullptr; |
| 604 | } while (false); |
| 605 | |
| 606 | PY_TRY |
| 607 | { |
| 608 | getMatrixPtr()->rotY(angle); |
| 609 | Py_Return; |
| 610 | } |
| 611 | PY_CATCH; |
| 612 | } |
| 613 |
nothing calls this directly
no test coverage detected