ViSP  2.10.0
vpRotationVector Class Reference

`#include <vpRotationVector.h>`

Inheritance diagram for vpRotationVector:

## Public Member Functions

vpRotationVector ()

vpRotationVector (const unsigned int n)

vpRotationVector (const vpRotationVector &v)

virtual ~vpRotationVector ()

double & operator[] (unsigned int n)

const double & operator[] (unsigned int n) const

vpRotationVectoroperator= (const vpRotationVector &v)

unsigned int size () const

vpRowVector t () const

## Protected Member Functions

void init (const unsigned int size)

## Protected Attributes

double * r

unsigned int _size

## Friends

class vpColVector

VISP_EXPORT std::ostream & operator<< (std::ostream &s, const vpRotationVector &m)

## Detailed Description

Class that consider the case of a generic rotation vector (cannot be used as is !) consisting in three angles.

The code below shows how this class can be used to manipulate a vpRxyzVector.

#include <iostream>
#include <visp/vpRxyzVector.h>
#include <visp/vpMath.h>
int main()
{
vpRxyzVector r; // By default initialized to zero
r[0] = vpMath::rad(45); // Rotation around x set to 45 degres converted in radians
r[1] = M_PI; // Rotation around y set to PI radians
r[2] = 0; // Rotation around z set to 0 radians
std::cout << "Rxyz rotation vector: " << r << std::endl;
double rx = r[0]; // Get the value of the angle around x axis
double ry = r[1]; // Get the value of the angle around y axis
double rz = r[2]; // Get the value of the angle around z axis
}

Definition at line 94 of file vpRotationVector.h.

## Constructor & Destructor Documentation

 vpRotationVector::vpRotationVector ( )
inline

Constructor that constructs a vector of size 3 and initialize all values to zero.

Definition at line 103 of file vpRotationVector.h.

References vpMatrix::init().

 vpRotationVector::vpRotationVector ( const unsigned int n )
inline

Constructor that constructs a vector of size n and initialize all values to zero.

Definition at line 110 of file vpRotationVector.h.

References vpMatrix::init().

 vpRotationVector::vpRotationVector ( const vpRotationVector & v )
inline

Copy operator.

Definition at line 118 of file vpRotationVector.h.

 vpRotationVector::~vpRotationVector ( )
virtual

Definition at line 123 of file vpRotationVector.cpp.

References r.

## Member Function Documentation

 void vpRotationVector::init ( const unsigned int size )
protected

Definition at line 117 of file vpRotationVector.cpp.

References _size, and r.

 vpRotationVector& vpRotationVector::operator= ( const vpRotationVector & v )
inline

Affectation of two vectors.

Definition at line 140 of file vpRotationVector.h.

References vpMatrix::init(), r, and size().

 double& vpRotationVector::operator[] ( unsigned int n )
inline

Operator that allows to set the value of an element of the rotation vector: r[i] = value

Definition at line 130 of file vpRotationVector.h.

 const double& vpRotationVector::operator[] ( unsigned int n ) const
inline

Operator that allows to get the value of an element of the rotation vector: value = r[i]

Definition at line 135 of file vpRotationVector.h.

 unsigned int vpRotationVector::size ( ) const

Returns the size of the rotation vector

Size of the rotation vector: number of double values describing the rotation. Common sizes are 4 for a quaternion and 3 for angle-based rotation vectors.

Definition at line 71 of file vpRotationVector.cpp.

References _size.

Referenced by operator=().

 vpRowVector vpRotationVector::t ( ) const

Return the transpose of the rotation vector.

Examples:
testViper850.cpp.

Definition at line 57 of file vpRotationVector.cpp.

References _size, and r.

## Friends And Related Function Documentation

 VISP_EXPORT std::ostream& operator<< ( std::ostream & s, const vpRotationVector & m )
friend

Print the values of the three angles on the output stream. Data are formatted as a column vector.

#include <iostream>
#include <visp/vpRxyzVector.h>
int main()
{
vpRxyzVector r; // By default initialized to zero
std::cout << "Rxyz rotation vector: " << std::endl << r << std::endl;
}

will lead to the following printing on the standart stream:

Rxyz rotation vector:
0
0
0

Definition at line 100 of file vpRotationVector.cpp.

 friend class vpColVector
friend

Definition at line 96 of file vpRotationVector.h.

## Member Data Documentation

 unsigned int vpRotationVector::_size
protected

Definition at line 99 of file vpRotationVector.h.

Referenced by init(), size(), t(), and vpColVector::vpColVector().

 double* vpRotationVector::r
protected