From 658f1589aed49db8d6c05e08bf302029ad98dc06 Mon Sep 17 00:00:00 2001 From: Vivien Engling Date: Thu, 15 Oct 2026 13:27:12 +0200 Subject: [PATCH] compute.py finalisiert und formatiert --- .idea/vcs.xml | 6 ++++++ compute.py | 11 ++++------- 2 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 .idea/vcs.xml diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/compute.py b/compute.py index 8c70983..b663453 100644 --- a/compute.py +++ b/compute.py @@ -12,8 +12,7 @@ from typing import List def matmul( - matrix_a: List[List[float]], - matrix_b: List[List[float]] + matrix_a: List[List[float]], matrix_b: List[List[float]] ) -> List[List[float]]: """Multiply two 2D matrices. @@ -142,10 +141,8 @@ def rot_2D(theta: float) -> List[List[float]]: """ c = math.cos(theta) s = math.sin(theta) - return [ - [c, -s], - [s, c] - ] + return [[c, -s], [s, c]] + if __name__ == "__main__": # Testdaten für die Demonstration @@ -167,4 +164,4 @@ if __name__ == "__main__": print(f"rot_2D (pi / 2 radians / 90 degrees):") rotation_matrix = rot_2D(angle) for row in rotation_matrix: - print([round(val, 4) for val in row]) \ No newline at end of file + print([round(val, 4) for val in row])