Tabulate und Ruff eingefügt, Ruff Check durchgeführt
This commit is contained in:
1 parent
ee696cfa98
commit
090453d4aa
2 files changed
+9
-5
No files matched your search
+7
-4
@@ -12,10 +12,12 @@ Functions:
|
|||||||
# Teständerung
|
# Teständerung
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
from typing import List
|
|
||||||
import math
|
import math
|
||||||
|
|
||||||
Matrix = List[List[float]]
|
from tabulate import tabulate
|
||||||
|
|
||||||
|
Matrix = list[list[float]]
|
||||||
|
|
||||||
def transpose(matrix: Matrix) -> Matrix:
|
def transpose(matrix: Matrix) -> Matrix:
|
||||||
"""Return the transpose of *matrix*.
|
"""Return the transpose of *matrix*.
|
||||||
@@ -110,7 +112,7 @@ def matmul(A: Matrix, B: Matrix) -> Matrix:
|
|||||||
|
|
||||||
result: Matrix = []
|
result: Matrix = []
|
||||||
for i in range(a_rows):
|
for i in range(a_rows):
|
||||||
row: List[float] = []
|
row: list[float] = []
|
||||||
for j in range(b_cols):
|
for j in range(b_cols):
|
||||||
s = 0.0
|
s = 0.0
|
||||||
for k in range(a_cols):
|
for k in range(a_cols):
|
||||||
@@ -129,4 +131,5 @@ if __name__ == "__main__":
|
|||||||
# Einen Punkt (Vektor) als 2x1 Matrix rotieren: [ [x], [y] ]
|
# Einen Punkt (Vektor) als 2x1 Matrix rotieren: [ [x], [y] ]
|
||||||
point = [[1.0], [0.0]] # Punkt auf der x-Achse bei x=1, y=0
|
point = [[1.0], [0.0]] # Punkt auf der x-Achse bei x=1, y=0
|
||||||
rotated_point = matmul(R, point)
|
rotated_point = matmul(R, point)
|
||||||
print("Gedrehter Punkt (erwartet y=1, x=0):", rotated_point)
|
print("Gedrehter Punkt (erwartet y=1, x=0):", rotated_point)
|
||||||
|
print(tabulate(rot_2D(1.0)))
|
||||||
+2
-1
@@ -1,3 +1,4 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "matrixmania"
|
name = "matrixmania"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
dependencies = ["tabulate", "ruff"]
|
||||||
Reference in new issue
Block a user