From 1d441aea4446484342f93fbf315f7f70de8adaf7 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Tue, 23 Mar 2010 01:53:28 -0400 Subject: Implement most vector functions. --- tests/dimension/arithexp.pov | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'tests') 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) -- cgit v1.2.3