# 3D rigid motions, registration and robotics with Matlab

[code]

This toolbox provides a set of functions for modelling 3-D rigid motions including Euler angles, rotation and homogeneous matrixes, quaternions and dual quaternions, and axis/angle representations. These tools are commonly used in robotics, but they are equally useful for image registration and matching, image analysis and modeling, and others. Before using the toolbox, you should run the script:
>> setup__robotics_toolbox
that will temporarily fix your path to include all the required folders. In case you plan to use the toolbox regularly, you are suggested to include the line above in your 'startup.m' Matlab's config file.

The core of the toolbox is actually the object-oriented iterface (OOI) for quaternions, dual numbers, and dual quaternions algebra. Corresponding classes have been programmed for each one using Matlab's object oriented interface, allowing to use them in the same way real or complex numbers (or matrixes) are used. For example, a 3xN matrix xyz comprising N 3-D column vectors can be translated to its quaternion representation just by typing:
>> myquaternions = [ii,jj,kk]*xyz; % 1xN array of quaternions

Or you can compute the rotation angle they represent as:
>> angle(myquaternions),

Or you can compute their squares or compare them:
>> myquaternions.*myquaternions == myquaternions.^2
Note this module is similar to the [qtfm] package, but THEY ARE NOT equivalent. First, we use here dual quaternions instead of octonions. Besides, qtfm is quite more general since it manages quaternions with complex entries, which is not the case here: quaternions, dual numbers,  and dual quaternions are restricted to have only real entries. You may notice the difference with a very simple example:
>> q = quaternion(-1);
>> sqrt(q),
will return (0+1i) + (0+0i)*ii + (0+0i)*jj + (0+0i)*kk with qtfm, while the present software will return 0 + 1*ii + 0*jj + 0*kk. To get started, you can run any of the demos:
demo_quaternion
demo_dualnumber
demo_dualquaternion

The aim when designing this code was mainly to provide an intuitive and flexible interface to work with different representations of rigid motions. This means the software is not particularly optimized for performance/execution speed. However, an effort has been made to take advantage of Matlab's efficiency in matrix computations.

[code]