From f4053866258e48dd98136142471ecabf6c138160 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 19 May 2011 22:59:29 -0600 Subject: Add matricies to Python module. --- libdimension-python/tests/geometry.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'libdimension-python/tests') diff --git a/libdimension-python/tests/geometry.py b/libdimension-python/tests/geometry.py index b398a1b..8f76ef7 100755 --- a/libdimension-python/tests/geometry.py +++ b/libdimension-python/tests/geometry.py @@ -50,3 +50,16 @@ assert dot(v, v) == v.norm()**2, dot(v, v) assert v, bool(v) assert not Zero, not Zero assert proj(v, X) == 2*X, proj(v, X) + +assert scale(1, 2, 3) == Matrix(1, 0, 0, 0, + 0, 2, 0, 0, + 0, 0, 3, 0), \ + scale(1, 2, 3) +assert translate(x = 1, y = 2, z = 3) == Matrix(1, 0, 0, 1, + 0, 1, 0, 2, + 0, 0, 1, 3), \ + translate(x = 1, y = 2, z = 3) +assert rotate(90*Y) == Matrix( 0, 0, 1, 0, + 0, 1, 0, 0, + -1, 0, 0, 0), \ + rotate(90*Y) -- cgit v1.2.3