From f5cd79a40c7d1c0eb28a38fe1ab0359d5e5da986 Mon Sep 17 00:00:00 2001 From: taraseidler Date: Wed, 28 Oct 2026 16:05:22 +0100 Subject: [PATCH] =?UTF-8?q?in=20compute.py:=20Funktion=20project=5Fortho?= =?UTF-8?q?=20Implimentiert=20(f=C3=BCr=20die=20orthographische=20Projekti?= =?UTF-8?q?on=20eines=203D=20point)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit test-projection ergänzt,nach Arrange/Act/Assert gegliedert, ohne und mit skalierung --- Test/test_matrixmania/test_projection.py | 36 ++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Test/test_matrixmania/test_projection.py diff --git a/Test/test_matrixmania/test_projection.py b/Test/test_matrixmania/test_projection.py new file mode 100644 index 0000000..2be487a --- /dev/null +++ b/Test/test_matrixmania/test_projection.py @@ -0,0 +1,36 @@ +"""Machine tests for the orthographic projection in compute.py. + +Every test is structured according to the +Arrange - Act - Assert pattern. +""" + +import pytest + +from compute import project_ortho + + +def test_project_ortho_without_scale() -> None: + """project_ortho drops z and returns (x, y) unchanged.""" + # Arrange + point = (1.0, 2.0, 3.0) + expected = (1.0, 2.0) + + # Act + result = project_ortho(point) + + # Assert + assert result == pytest.approx(expected) + + +def test_project_ortho_with_scale_100() -> None: + """project_ortho with scale=100 scales the projected point.""" + # Arrange + point = (1.0, 2.0, 3.0) + scale = 100 + expected = (100.0, 200.0) + + # Act + result = project_ortho(point, scale) + + # Assert + assert result == pytest.approx(expected) \ No newline at end of file