Matrixfunktionen hinzugefügt und formatiert

This commit is contained in:
naifla103879 committed 2026-10-20 12:47:16 +02:00
1 parent 503d738c00
commit f1861b4a39
2 files changed
+5 -3

No files matched your search

+4 -3
View File
@@ -20,6 +20,8 @@ Python's built‑in integer and float handling.
import math
from tabulate import tabulate
def rot_2D(theta: float) -> list[list[float]]:
"""Return the 2‑D rotation matrix for a given angle.
@@ -85,7 +87,6 @@ def matmul(a: list[list[float | int]], b: list[list[float | int]]) -> list[list[
return result
def transpose(matrix: list[list[float | int]]) -> list[list[float | int]]:
"""Return the transpose of the given matrix.
@@ -139,5 +140,5 @@ if __name__ == "__main__":
matrix_c = matmul(matrix_a, matrix_b)
for row in matrix_c:
print(row)
print("\nRotation matrix 90°:\n", rot_2D(math.pi/2))
print("\nRotation matrix 90°:\n", rot_2D(math.pi / 2))
print(tabulate(rot_2D(1.0)))
+1
View File
@@ -1,3 +1,4 @@
[project]
name = "matrixmania"
version = "0.1.0"
dependencies = ["tabulate", "ruff"]