From 090453d4aa9b8e41849c5d8525a4ba09c5c8f619 Mon Sep 17 00:00:00 2001 From: MaaaartinTH Date: Thu, 15 Oct 2026 13:38:28 +0200 Subject: [PATCH] =?UTF-8?q?Tabulate=20und=20Ruff=20eingef=C3=BCgt,=20Ruff?= =?UTF-8?q?=20Check=20durchgef=C3=BChrt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- compute.py | 11 +++++++---- pyproject.toml | 3 ++- 2 files changed, 9 insertions(+), 5 deletions(-) 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