summaryrefslogtreecommitdiffstats
path: root/tests/dimension
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-03-23 01:53:28 -0400
committerTavian Barnes <tavianator@gmail.com>2010-03-23 01:53:28 -0400
commit1d441aea4446484342f93fbf315f7f70de8adaf7 (patch)
tree98dd1c7521155b0390976d847e841db2227a6704 /tests/dimension
parent7fc84f364bcb2e37363d3e22300180ba92288811 (diff)
downloaddimension-1d441aea4446484342f93fbf315f7f70de8adaf7.tar.xz
Implement most vector functions.
Diffstat (limited to 'tests/dimension')
-rw-r--r--tests/dimension/arithexp.pov33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/dimension/arithexp.pov b/tests/dimension/arithexp.pov
index 863c254..3f4e29b 100644
--- a/tests/dimension/arithexp.pov
+++ b/tests/dimension/arithexp.pov
@@ -154,6 +154,22 @@ sphere {
#error "val"
#end
+#if (vaxis_rotate(<1, 0, 0>, <1, 0, 1>, 180) != <0, 0, 1>)
+ #error "vaxis_rotate"
+#end
+
+#if (vaxis_rotate(1, 1, 180) != <1, 1, 1>)
+ #error "vaxis_rotate"
+#end
+
+#if (vcross(<1, 2, 3>, <3, 2, 1>) != <-4, 8, -4>)
+ #error "vcross"
+#end
+
+#if (vcross(1, 2) != 0)
+ #error "vcross"
+#end
+
#if (vdot(<1, 2, 3>, 2) != 12)
#error "vdot"
#end
@@ -170,6 +186,23 @@ sphere {
#error "vlength"
#end
+#if (vnormalize(<1, 1, 1>)
+ != <0.5773502691896258, 0.5773502691896258, 0.5773502691896258>)
+ #error "vnormalize"
+#end
+
+#if (vnormalize(1) != 0.4472135954999579) // Vector promoted comparison
+ #error "vnormalize"
+#end
+
+#if (vrotate(<1, 0, 0>, <0, -90, 0>) != <0, 0, 1>)
+ #error "vrotate"
+#end
+
+#if (vrotate(1, 2) != <1, 1, 1>)
+ #error "vrotate"
+#end
+
/* Float built-in IDs */
#if (pi != 3.141592653589793)