Abhängigkeiten ergänzt und Matrixausgabe formatiert
This commit is contained in:
1 parent
c4583b1016
commit
c110757218
2 files changed
+4
-4
No files matched your search
+3
-4
@@ -1,6 +1,7 @@
|
|||||||
# Matrixfunktionen für MatrixMania
|
# Matrixfunktionen für MatrixMania
|
||||||
"""Functions for matrix calculations."""
|
"""Functions for matrix calculations."""
|
||||||
|
import math
|
||||||
|
from tabulate import tabulate
|
||||||
|
|
||||||
def _validate_matrix(matrix: list[list[int | float]], name: str) -> tuple[int, int]:
|
def _validate_matrix(matrix: list[list[int | float]], name: str) -> tuple[int, int]:
|
||||||
"""Validate a non-empty, rectangular matrix with numeric entries.
|
"""Validate a non-empty, rectangular matrix with numeric entries.
|
||||||
@@ -131,9 +132,6 @@ def rotate(matrix: list[list[int | float]]) -> list[list[int | float]]:
|
|||||||
return [row[::-1] for row in transposed]
|
return [row[::-1] for row in transposed]
|
||||||
|
|
||||||
|
|
||||||
import math
|
|
||||||
|
|
||||||
|
|
||||||
def rot_2D(theta: float) -> list[list[float]]:
|
def rot_2D(theta: float) -> list[list[float]]:
|
||||||
"""Return the 2D rotation matrix for an angle in radians.
|
"""Return the 2D rotation matrix for an angle in radians.
|
||||||
|
|
||||||
@@ -228,5 +226,6 @@ if __name__ == "__main__":
|
|||||||
)
|
)
|
||||||
|
|
||||||
print("Test 9 passed:", rotation_90)
|
print("Test 9 passed:", rotation_90)
|
||||||
|
print(tabulate(rot_2D(1.0)))
|
||||||
|
|
||||||
|
|
||||||
@@ -2,3 +2,4 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "matrixmania"
|
name = "matrixmania"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
dependencies = ["tabulate", "ruff"]
|
||||||
Reference in new issue
Block a user