C++11 Basics

Preliminaries

All code in this section expects you to have the include and using in the beginning of your file

#include<dqrobotics/DQ.h>

using namespace DQ_robotics;

Binary Operations

Preliminaries

Suppose you have the dual quaternions

\(\dq{h_1}=1+\imi+\imj+\imk+\dual(1 + \imi + \imj + \imk)\)

and

\(\dq{h_2}=2+2\imi+2\imj+2\imk+\dual(2 + 2\imi + 2\imj + 2\imk)\).

They can be declared in DQ Robotics as

DQ h1(1,1,1,1,1,1,1,1);
DQ h2(2,2,2,2,2,2,2,2);

Operations

  1. Sum \(\dq{h_3} = \dq{h_1} + \dq{h_2}\)

DQ h3 = h1+h2;
  1. Subtraction \(\dq{h_3} = \dq{h_1} - \dq{h_2}\)

DQ h3 = h1-h2;
  1. Multiplication \(\dq{h_3} = \dq{h_1}\dq{h_2}\)

DQ h3 = h1*h2;