Leichte Änderungen gemacht
This commit is contained in:
1 parent
6ededbc4c2
commit
3b7e11b341
3 files changed
+62
-3
No files matched your search
@@ -1,4 +1,6 @@
|
||||
from matrixmania import project_ortho
|
||||
import pytest
|
||||
|
||||
from matrixmania import project_ortho, project_perspective
|
||||
|
||||
|
||||
def test_project_ortho_without_scale():
|
||||
@@ -23,4 +25,28 @@ def test_project_ortho_with_scale_100():
|
||||
result = project_ortho(point, scale=scale)
|
||||
|
||||
# Assert
|
||||
assert result == expected
|
||||
assert result == expected
|
||||
|
||||
|
||||
def test_project_perspective_without_scale():
|
||||
# Arrange
|
||||
point = (1.0, 2.0, 3.0)
|
||||
expected = (1 / 7, 2 / 7)
|
||||
|
||||
# Act
|
||||
result = project_perspective(point, focal_length=1, scale=1)
|
||||
|
||||
# Assert
|
||||
assert result == pytest.approx(expected)
|
||||
|
||||
|
||||
def test_project_perspective_with_scale_100_and_focal_length_2():
|
||||
# Arrange
|
||||
point = (1.0, 2.0, 3.0)
|
||||
expected = (200 / 7, 400 / 7)
|
||||
|
||||
# Act
|
||||
result = project_perspective(point, focal_length=2, scale=100)
|
||||
|
||||
# Assert
|
||||
assert result == pytest.approx(expected)
|
||||
Reference in new issue
Block a user