TclMatrix3d

A binary extension written by Sean Deely Woods.

It provides high-speed 3d rotation and vector manipulation through a new command vexpr.

vexpr uses reverse-polish notation. Commands and arguments are pushed into a stack, and the topmost element in the stack is returned as the result. This was done for partly ease of implementation, and partly because no order of operations rightly exists for matrix operations. The code and documentation is available for download at:

http://www.etoyoc.com/tclmatrix3d

A binary of the library is available for Linux. The package is not platform specific, and should run under any platform with the proper Makefile.


Example usage:

Difference of vectors:

   vexpr {1 1 1} {2 2 2} -
   > 1.0 1.0 1.0
   vexpr {2 2 2} {1 1 1} -
   > -1.0 -1.0 -1.0

The robot arm with 3 degrees of freedom: https://web.archive.org/web/20070208053604/www.etoyoc.com/tclmatrix3d/bend.gif

   # Positions of the joints
   set A_pos {0.0 0.0 0.0}
   set B_pos {1.0 0.0 0.0}
   set C_pos {2.0 0.0 0.0} 

   # Rotations of the joints 
   set A_rot {0 0 45}
   set B_rot {0 0 45}

   set b_transform [vexpr 
        $A_pos $B_pos -
        affine_translate
        $A_rot radiens 
        affine_rotate
        affine_multiply]
   set b_real [vexpr $B_pos $b_transform vector_transform]
   set c_transform [vexpr 
        $C_pos $B_real - 
        affine_translate 
        load affine_multiply 
        $B_rot radiens
        affine_rotate 
        affine_multiply]

   set c_real [vexpr $C_pos $c_transform vector_transform]
   > 0.0 2.0 0.0