Version 2

This commit is contained in:
Mona Benkert 2025-11-06 12:23:04 +01:00
parent f5afa78ff9
commit 23e7c63d11
4 changed files with 30 additions and 2 deletions

View File

@ -7,6 +7,7 @@ This Package contains a few fundamental function which can be used for **matrice
- matmul function - matmul function
- transpose function - transpose function
- rot_2D function - rot_2D function
- rot_3D function
## matmul function: ## matmul function:
@ -89,4 +90,25 @@ rotation matrix for 90°:
6.12323e-17 -1 6.12323e-17 -1
1 6.12323e-17 1 6.12323e-17
----------- ------------ ----------- ------------
```
## rot_3D function:
This function calculates the rotation matrix for one 3D axis (x, y, z) for a certain angle.
**Example:**
```
theta = math.pi / 2
R = rot_3D(theta, "y")
print("rotation matrix for 90° on the y axis:")
print(tabulate(R))
```
**Result:**
```
rotation matrix for 90° on the y axis:
------------ - -----------
6.12323e-17 0 1
0 1 0
-1 0 6.12323e-17
------------ - -----------
``` ```

View File

@ -1 +1 @@
from .compute import matmul, transpose, rot_2D from .compute import matmul, transpose, rot_2D, rot_3D

View File

@ -127,3 +127,9 @@ if __name__ == "__main__":
print("Matrix A:") print("Matrix A:")
print(tabulate(matrix_a)) print(tabulate(matrix_a))
theta = math.pi / 2
R = rot_3D(theta, "y")
print("rotation matrix for 90° on the y axis:")
print(tabulate(R))

View File

@ -1,6 +1,6 @@
[project] [project]
name = "matrixmania_benkertmo99686" name = "matrixmania_benkertmo99686"
version = "0.1.0" version = "0.2.0"
description = "MatrixMania: Simple linear algebra functions for teaching (matmul, transpose, rot_2D)." description = "MatrixMania: Simple linear algebra functions for teaching (matmul, transpose, rot_2D)."
authors = [ authors = [
{ name="Mona Benkert", email="benkertmo99686@th-nuernberg.de" } { name="Mona Benkert", email="benkertmo99686@th-nuernberg.de" }