Add orthogonal projection and tests
This commit is contained in:
1 parent
17eff74d0c
commit
4931d5e7dc
4 files changed
+46
-2
No files matched your search
@@ -0,0 +1,28 @@
|
||||
from compute import project_ortho
|
||||
|
||||
|
||||
def test_project_ortho_without_scaling() -> None:
|
||||
"""Test orthogonal projection without scaling."""
|
||||
# Arrange
|
||||
point = (1.0, 2.0, 3.0)
|
||||
expected = (1.0, 2.0)
|
||||
|
||||
# Act
|
||||
result = project_ortho(point)
|
||||
|
||||
# Assert
|
||||
assert result == expected
|
||||
|
||||
|
||||
def test_project_ortho_with_scaling() -> None:
|
||||
"""Test orthogonal projection with a scale factor of 100."""
|
||||
# Arrange
|
||||
point = (1.0, 2.0, 3.0)
|
||||
scale = 100
|
||||
expected = (100.0, 200.0)
|
||||
|
||||
# Act
|
||||
result = project_ortho(point, scale)
|
||||
|
||||
# Assert
|
||||
assert result == expected
|
||||
Reference in new issue
Block a user