This is a library for using and manipulating unit dual quaternions (Clifford algebra Cl^+(0,3,1). Unit dual quaternions are useful for describing rigid body movements using screw theory. Main applications of using unit dual quaternions are found in kinematics.

The core of the library is written in C. However, a Lua interface is also provided which is installable by means of LuaRocks. This provides a simple interface for the quick prototyping of projects.

  • Type: library
  • Version: Feb, 2013
  • Language: C, Lua
  • License: LGPLv3+
  • Dependencies none


This is a library for using and manipulating dual quaternions. Dual quaternions are useful for describing rigid body movements using screw theory.

If you use this library please reference it.


In order to assist potential users, a small tutorial was written for the Lua interface of libdq. The tutorial and it’s associated files are listed below:

  • luadq-tut: An example tutorial of luadq, the Lua interface of libdq.
  • e2scara.lua: The Epson E2L Scara Robot example Lua file shown in the tutorial.


Copyright 2010-2013 Edgar Simo-Serra
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program.  If not, see <>.


To install type:

$ make install

To make documentation (recommended) type:

$ make docs

Docs are located in the docs folder that will be created when you run make docs.


  • Version 2.2, February 2013
    • Fixed build on newest Ubuntu
    • Added version command to Lua API
    • Compatibility with Lua 5.2
  • Version 2.1, April 2012
    • Made it more clear license is LGPL
    • Fixed bug in Lua handling of matrices
    • Added defines for getting version
    • Added dq_version, dq_ch_plane_point, dq_cr_plane
    • Minor correctness fixes
  • Version 2.0, April 2011
    • Lua bindings
  • Version 1.5, April 2011
    • Install headers into /usr/include/dq by default instead of prefixing with dq_.
    • Updated documentation
    • Make docs now places final documentation in /
  • Version 1.4, February 2011
    • Fixed major issue in dual quaternion conjugation
    • Added dq_op_extract
    • Added mat3_solve
    • Added vec3_sign
    • Added vec3_distance
    • Minor doxygen improvements
  • Version 1.3, December 2010
    • Cleaned up and documented the auxiliary function files so they can be used.
  • Version 1.2, December 2010
    • Added dq_op_sign to change sign of a dual quaternion.
    • dq_ch_cmp and dq_ch_cmpV now take into account the fact it could be with a different sign.
  • Version 1.1, November 2010
    • Fixed dual quaternion multiplication
    • Implemented more strict unit tests
    • Misc fixes
  • Version 1.0, November 2010
    • Initial Revision


A big thanks to Alba Perez for having the patience to deal with my repetitive boring dual quaternion questions and for lending me her notes.