returns the minor along (x, y)
(self, x: int, y: int)
| 381 | raise Exception("change_component: indices out of bounds") |
| 382 | |
| 383 | def minor(self, x: int, y: int) -> float: |
| 384 | """ |
| 385 | returns the minor along (x, y) |
| 386 | """ |
| 387 | if self.__height != self.__width: |
| 388 | raise Exception("Matrix is not square") |
| 389 | minor = self.__matrix[:x] + self.__matrix[x + 1 :] |
| 390 | for i in range(len(minor)): |
| 391 | minor[i] = minor[i][:y] + minor[i][y + 1 :] |
| 392 | return Matrix(minor, self.__width - 1, self.__height - 1).determinant() |
| 393 | |
| 394 | def cofactor(self, x: int, y: int) -> float: |
| 395 | """ |