Matrixfunktionen hinzugefügt und formatiert
This commit is contained in:
1 parent
503d738c00
commit
f1861b4a39
2 files changed
+6
-4
No files matched your search
+4
-3
@@ -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)))
|
||||
Reference in new issue
Block a user