From 130e6c36f43e908f943705d34254e64cf0216206 Mon Sep 17 00:00:00 2001 From: marcelbls Date: Thu, 20 Nov 2025 14:20:08 +0100 Subject: [PATCH] add project_ortho --- matrixmania/compute.py | 3 +++ tests/test_projection.py | 1 + 2 files changed, 4 insertions(+) create mode 100644 tests/test_projection.py diff --git a/matrixmania/compute.py b/matrixmania/compute.py index 7bb5889..c988857 100644 --- a/matrixmania/compute.py +++ b/matrixmania/compute.py @@ -1,6 +1,7 @@ from typing import List import math from tabulate import tabulate +from typing import Tuple def matmul(matrix_a: List[List[int]], matrix_b: List[List[int]]) -> List[List[int]]: """ @@ -95,6 +96,8 @@ def rot_3D(angle: float, axis: str) -> List[List[float]]: else: raise ValueError("Not a valid axis. Choose from 'x', 'y', 'z'.") +def project_ortho(point: Tuple[float, float, float], scale: float = 1) -> Tuple[float, float]: + return (point[0]*scale, point[1]*scale) if __name__ == "__main__": diff --git a/tests/test_projection.py b/tests/test_projection.py new file mode 100644 index 0000000..8715041 --- /dev/null +++ b/tests/test_projection.py @@ -0,0 +1 @@ +from matrixmania import project_ortho