diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fb25c24 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/matrixmania/dist/ diff --git a/README.md b/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/ requirements.txt b/matrixmania/ requirements.txt similarity index 100% rename from requirements.txt rename to matrixmania/ requirements.txt diff --git a/matrixmania/README.md b/matrixmania/README.md new file mode 100644 index 0000000..c1bba8d --- /dev/null +++ b/matrixmania/README.md @@ -0,0 +1,16 @@ +## Compute.py +### Functions: +**matmul(matrix_a, matrix_b):** + +Multipliziert zwei Matrizen miteinander und gibt das Produkt als neue Matrix zurück. +Wirft einen ValueError, wenn die Matrizen aufgrund unpassender Dimensionen nicht multiplizierbar sind. + +**transpose(matrix):** + +Gibt die Transponierte einer gegebenen Matrix zurück (Zeilen und Spalten werden vertauscht). +Überprüft, ob die Matrix leer oder fehlerhaft aufgebaut ist, und wirft in diesem Fall einen ValueError. + +**rot_2D(angle):** + +Erzeugt eine 2D-Rotationsmatrix für einen gegebenen Winkel (in Grad). +Diese Matrix kann verwendet werden, um Punkte in der Ebene um den Ursprung zu rotieren. diff --git a/matrixmania/__init__.py b/matrixmania/__init__.py new file mode 100644 index 0000000..975a585 --- /dev/null +++ b/matrixmania/__init__.py @@ -0,0 +1 @@ +from .compute import matmul, transpose, rot_2D \ No newline at end of file diff --git a/compute..py b/matrixmania/compute.py similarity index 96% rename from compute..py rename to matrixmania/compute.py index 8571734..e9b3c0a 100644 --- a/compute..py +++ b/matrixmania/compute.py @@ -61,10 +61,10 @@ def transpose(matrix: list[list[int]]) -> list[list[int]]: return ergebnis2 -def rot_2D(angle: int) -> List[List[int]]: +def rot_2D(angle: int) -> List[List[float]]: """ Rotation matrix - :param angle: any angle + :param angle: any angle in degrees :return: rotation matrix """ zahl1 = math.cos(math.radians(angle)) diff --git a/matrixmania/pyproject.toml b/matrixmania/pyproject.toml new file mode 100644 index 0000000..99e7bd6 --- /dev/null +++ b/matrixmania/pyproject.toml @@ -0,0 +1,17 @@ +[project] +name = "matrixmania_marcel" +version = "0.1.0" +description = "MatrixMania: Simple linear algebra functions for teaching (matmul, transpose, rot_2D)." + +authors = [ + { name="Dein Name", email="deine.mail@th-nuernberg.de" } +] +readme = "README.md" +license = { text = "MIT" } +requires-python = ">=3.7" +dependencies = ["tabulate"] +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" +[tool.hatch.build.targets.wheel] +packages = ["matrixmania"] \ No newline at end of file