jetzt funktionierts

This commit is contained in:
Tonii2206 committed 2026-10-27 09:56:49 +01:00
1 parent bb785bb25c
commit 71c9eb485b
2 files changed
+30 -2

No files matched your search

+7 -2
View File
@@ -23,8 +23,6 @@ __all__ = ["matmul", "transpose"]
def matmul(a: list[list[float]] , b:list[list[float]]) -> list[list[float]]:
"""Return the product of two matrices ``a`` and ``b``.
Returns
-------
List[List[float]]
@@ -169,6 +167,13 @@ def transpose(a: list[list[float]]) -> list[list[float]]:
[row[i] for row in a]
for i in range(len(a[0]))
]
def project_ortho(point: tuple[float, float], scale: float= 1) -> tuple[float, float]:
#das dreidimensionale wird zweidimensional gezeichnet z muss hinten immer weg
x, y, z = point
return (x * scale, y * scale)
def main() -> None:
"""Demonstrate :func:`matmul` with a simple example.
This function is only executed when the module is run as a script.
+23
View File
@@ -0,0 +1,23 @@
from matrixmania.compute import project_ortho
def test_project_ortho_ohneSkalierung():
# Arrange
point =(1, 2, 3)
expected = (1, 2)
#Act
result = project_ortho(point)
#Assert
assert result == expected
def test_project_ortho_mitskalierung():
#Arrange
point = (1, 2, 3)
scale = 100
expected =(100, 200)
#Act
result = project_ortho(point, scale)
#Assert
assert result == expected