Compare commits

...
3 Commits
Author SHA1 Message Date
naifla103879 f1861b4a39 Matrixfunktionen hinzugefügt und formatiert 2026-10-20 12:47:16 +02:00
naifla103879 503d738c00 Projektregeln hinzugefügt 2026-10-20 12:37:02 +02:00
naifla103879 b5b9bfb5f0 Projektregeln hinzugefügt 2026-10-20 12:34:46 +02:00
4 changed files with 15 additions and 3 deletions

No files matched your search

+4
View File
@@ -0,0 +1,4 @@
# Regeln für dieses Projekt
- Code nach PEP 8, Zeilenlänge maximal 88 Zeichen.
- Jede Funktion und Methode hat einen Docstring und Type Hints.
- Vor jedem Commit: `ruff check` und `ruff format`.
+4 -3
View File
@@ -20,6 +20,8 @@ Python's built‑in integer and float handling.
import math import math
from tabulate import tabulate
def rot_2D(theta: float) -> list[list[float]]: def rot_2D(theta: float) -> list[list[float]]:
"""Return the 2‑D rotation matrix for a given angle. """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 return result
def transpose(matrix: list[list[float | int]]) -> list[list[float | int]]: def transpose(matrix: list[list[float | int]]) -> list[list[float | int]]:
"""Return the transpose of the given matrix. """Return the transpose of the given matrix.
@@ -139,5 +140,5 @@ if __name__ == "__main__":
matrix_c = matmul(matrix_a, matrix_b) matrix_c = matmul(matrix_a, matrix_b)
for row in matrix_c: for row in matrix_c:
print(row) 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)))
+3
View File
@@ -0,0 +1,3 @@
.venv/
__pycache__/
.env
+4
View File
@@ -0,0 +1,4 @@
[project]
name = "matrixmania"
version = "0.1.0"
dependencies = ["tabulate", "ruff"]