diff --git a/compute.py b/compute.py index e802a48..d33f729 100644 --- a/compute.py +++ b/compute.py @@ -12,10 +12,12 @@ Functions: # Teständerung from __future__ import annotations -from typing import List + import math -Matrix = List[List[float]] +from tabulate import tabulate + +Matrix = list[list[float]] def transpose(matrix: Matrix) -> Matrix: """Return the transpose of *matrix*. @@ -110,7 +112,7 @@ def matmul(A: Matrix, B: Matrix) -> Matrix: result: Matrix = [] for i in range(a_rows): - row: List[float] = [] + row: list[float] = [] for j in range(b_cols): s = 0.0 for k in range(a_cols): @@ -129,4 +131,5 @@ if __name__ == "__main__": # Einen Punkt (Vektor) als 2x1 Matrix rotieren: [ [x], [y] ] point = [[1.0], [0.0]] # Punkt auf der x-Achse bei x=1, y=0 rotated_point = matmul(R, point) - print("Gedrehter Punkt (erwartet y=1, x=0):", rotated_point) \ No newline at end of file + print("Gedrehter Punkt (erwartet y=1, x=0):", rotated_point) + print(tabulate(rot_2D(1.0))) \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 46e3b47..3a776b1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,4 @@ [project] name = "matrixmania" -version = "0.1.0" \ No newline at end of file +version = "0.1.0" +dependencies = ["tabulate", "ruff"] \ No newline at end of file