toml update, compute.py test_function und tabulate Ausgabe
This commit is contained in:
1 parent
560b3d8e51
commit
65297dd574
3 files changed
+14
-2
No files matched your search
@@ -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`.
|
||||||
+6
-2
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
import math
|
import math
|
||||||
|
|
||||||
|
from tabulate import tabulate
|
||||||
|
|
||||||
|
|
||||||
def matmul(matrix_a: list[list[float]], matrix_b: list[list[float]]) -> list[list[float]]:
|
def matmul(matrix_a: list[list[float]], matrix_b: list[list[float]]) -> list[list[float]]:
|
||||||
"""Berechnet das Matrixprodukt zweier Matrizen (matrix_a @ matrix_b).
|
"""Berechnet das Matrixprodukt zweier Matrizen (matrix_a @ matrix_b).
|
||||||
@@ -74,7 +76,8 @@ def rot_2d(angle: float) -> list[list[float]]:
|
|||||||
[sin_theta, cos_theta],
|
[sin_theta, cos_theta],
|
||||||
]
|
]
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
|
def test_functions():
|
||||||
a1 = [
|
a1 = [
|
||||||
[3, 4, -1, 4],
|
[3, 4, -1, 4],
|
||||||
[-2, 2, 5, 1],
|
[-2, 2, 5, 1],
|
||||||
@@ -171,4 +174,5 @@ if __name__ == "__main__":
|
|||||||
assert math.isclose(rotated_point[1][0], 1.0, abs_tol=1e-9)
|
assert math.isclose(rotated_point[1][0], 1.0, abs_tol=1e-9)
|
||||||
print("Test rot_2D (Vektordrehung mit matmul) erfolgreich bestanden!")
|
print("Test rot_2D (Vektordrehung mit matmul) erfolgreich bestanden!")
|
||||||
|
|
||||||
# Test-Änderung
|
if __name__ == "__main__":
|
||||||
|
print(tabulate(rot_2d(1.0)))
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
[project]
|
||||||
|
name = "matrixmania"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = ["tabulate", "ruff"]
|
||||||
Reference in new issue
Block a user