diff --git a/modules/core/include/visp3/core/vpRxyzVector.h b/modules/core/include/visp3/core/vpRxyzVector.h index 9c13ec776c..2a72c79a65 100644 --- a/modules/core/include/visp3/core/vpRxyzVector.h +++ b/modules/core/include/visp3/core/vpRxyzVector.h @@ -137,37 +137,37 @@ class vpThetaUVector; from the build rotation matrix. \code -#include -#include -#include -#include + #include + #include + #include + #include -int main() -{ - vpRxyzVector rxyz; + int main() + { + vpRxyzVector rxyz; - // Initialise the Euler angles - rxyz[0] = vpMath::rad( 45.f); // phi angle in rad around x axis - rxyz[1] = vpMath::rad(-30.f); // theta angle in rad around y axis - rxyz[2] = vpMath::rad( 90.f); // psi angle in rad around z axis + // Initialise the Euler angles + rxyz[0] = vpMath::rad( 45.f); // phi angle in rad around x axis + rxyz[1] = vpMath::rad(-30.f); // theta angle in rad around y axis + rxyz[2] = vpMath::rad( 90.f); // psi angle in rad around z axis - // Construct a rotation matrix from the Euler angles - vpRotationMatrix R(rxyz); + // Construct a rotation matrix from the Euler angles + vpRotationMatrix R(rxyz); - // Extract the Euler angles around x,y,z axis from a rotation matrix - rxyz.buildFrom(R); + // Extract the Euler angles around x,y,z axis from a rotation matrix + rxyz.buildFrom(R); - // Print the extracted Euler angles. Values are the same than the - // one used for initialization - std::cout << rxyz; + // Print the extracted Euler angles. Values are the same than the + // one used for initialization + std::cout << rxyz; - // Since the rotation vector is 3 values column vector, the - // transpose operation produce a row vector. - vpRowVector rxyz_t = rxyz.t(); + // Since the rotation vector is 3 values column vector, the + // transpose operation produce a row vector. + vpRowVector rxyz_t = rxyz.t(); - // Print the transpose row vector - std::cout << rxyz_t << std::endl; -} + // Print the transpose row vector + std::cout << rxyz_t << std::endl; + } \endcode */ diff --git a/modules/core/src/math/transformation/vpRxyzVector.cpp b/modules/core/src/math/transformation/vpRxyzVector.cpp index 4eb17b8b43..704881fde9 100644 --- a/modules/core/src/math/transformation/vpRxyzVector.cpp +++ b/modules/core/src/math/transformation/vpRxyzVector.cpp @@ -31,8 +31,7 @@ * Description: * Rxyz angle parameterization for the rotation. * Rxyz(phi,theta,psi) = Rot(x,phi)Rot(y,theta)Rot(z,psi). - * -*****************************************************************************/ + */ #include @@ -170,18 +169,18 @@ vpRxyzVector vpRxyzVector::buildFrom(const std::vector &rxyz) \param v : Angle value to set for each element of the vector. -\code -#include -#include + \code + #include + #include -int main() -{ - vpRxyzVector v; + int main() + { + vpRxyzVector v; - // Initialise the rotation vector - v = vpMath::rad( 45.f); // All the 3 angles are set to 45 degrees -} -\endcode + // Initialise the rotation vector + v = vpMath::rad( 45.f); // All the 3 angles are set to 45 degrees + } + \endcode */ vpRxyzVector &vpRxyzVector::operator=(double v) { @@ -196,23 +195,22 @@ vpRxyzVector &vpRxyzVector::operator=(double v) Copy operator that initializes a \f$R_{xyz}=(\varphi,\theta,\psi)\f$ Euler angles vector from a 3-dimension column vector. - \param rxyz : 3-dimension vector containing the values of the rotation -vector. - -\code -#include + \param rxyz : 3-dimension vector containing the values of the rotation vector. -int main() -{ - vpColVector v(3); - v[0] = 0.1; - v[1] = 0.2; - v[2] = 0.3; - vpRxyzVector rxyz; - rxyz = v; - // rxyz is now equal to v : 0.1, 0.2, 0.3 -} -\endcode + \code + #include + + int main() + { + vpColVector v(3); + v[0] = 0.1; + v[1] = 0.2; + v[2] = 0.3; + vpRxyzVector rxyz; + rxyz = v; + // rxyz is now equal to v : 0.1, 0.2, 0.3 + } + \endcode */ vpRxyzVector &vpRxyzVector::operator=(const vpColVector &rxyz) { @@ -230,17 +228,17 @@ vpRxyzVector &vpRxyzVector::operator=(const vpColVector &rxyz) /*! Set vector from a list of 3 double angle values in radians. \code -#include + #include -int main() -{ - vpRxyzVector rxyz = {M_PI, 0, M_PI_2}; - std::cout << "rxyz: " << rxyz.t() << std::endl; -} + int main() + { + vpRxyzVector rxyz = {M_PI, 0, M_PI_2}; + std::cout << "rxyz: " << rxyz.t() << std::endl; + } \endcode It produces the following printings: \code -rxyz: 3.141592654 0 1.570796327 + rxyz: 3.141592654 0 1.570796327 \endcode \sa operator<<() */ diff --git a/modules/core/src/math/transformation/vpRzyxVector.cpp b/modules/core/src/math/transformation/vpRzyxVector.cpp index 523e917e93..1d8c7613e2 100644 --- a/modules/core/src/math/transformation/vpRzyxVector.cpp +++ b/modules/core/src/math/transformation/vpRzyxVector.cpp @@ -176,18 +176,18 @@ vpRzyxVector vpRzyxVector::buildFrom(const std::vector &rzyx) \param v : Angle value to set for each element of the vector. -\code -#include -#include + \code + #include + #include -int main() -{ - vpRzyxVector v; + int main() + { + vpRzyxVector v; - // Initialise the rotation vector - v = vpMath::rad( 45.f); // All the 3 angles are set to 45 degrees -} -\endcode + // Initialise the rotation vector + v = vpMath::rad( 45.f); // All the 3 angles are set to 45 degrees + } + \endcode */ vpRzyxVector &vpRzyxVector::operator=(double v) { @@ -202,23 +202,22 @@ vpRzyxVector &vpRzyxVector::operator=(double v) Copy operator that initializes a \f$R_{zyx}=(\varphi,\theta,\psi)\f$ Euler angles vector from a 3-dimension column vector. - \param rzyx : 3-dimension vector containing the values of the rotation -vector. - -\code -#include + \param rzyx : 3-dimension vector containing the values of the rotation vector. -int main() -{ - vpColVector v(3); - v[0] = 0.1; - v[1] = 0.2; - v[2] = 0.3; - vpRzyxVector rzyx; - rzyx = v; - // rzyx is now equal to v : 0.1, 0.2, 0.3 -} -\endcode + \code + #include + + int main() + { + vpColVector v(3); + v[0] = 0.1; + v[1] = 0.2; + v[2] = 0.3; + vpRzyxVector rzyx; + rzyx = v; + // rzyx is now equal to v : 0.1, 0.2, 0.3 + } + \endcode */ vpRzyxVector &vpRzyxVector::operator=(const vpColVector &rzyx) { @@ -236,17 +235,17 @@ vpRzyxVector &vpRzyxVector::operator=(const vpColVector &rzyx) /*! Set vector from a list of 3 double angle values in radians. \code -#include + #include -int main() -{ - vpRzyxVector rzyx = {M_PI, 0, M_PI_2}; - std::cout << "rzyx: " << rzyx.t() << std::endl; -} + int main() + { + vpRzyxVector rzyx = {M_PI, 0, M_PI_2}; + std::cout << "rzyx: " << rzyx.t() << std::endl; + } \endcode It produces the following printings: \code -rzyx: 3.141592654 0 1.570796327 + zyx: 3.141592654 0 1.570796327 \endcode \sa operator<<() */ diff --git a/modules/core/src/math/transformation/vpRzyzVector.cpp b/modules/core/src/math/transformation/vpRzyzVector.cpp index e396fb5fdb..f3fe667c06 100644 --- a/modules/core/src/math/transformation/vpRzyzVector.cpp +++ b/modules/core/src/math/transformation/vpRzyzVector.cpp @@ -31,8 +31,7 @@ * Description: * Euler angles parameterization for the rotation. * Rzyz(phi,theta,psi) = Rot(z,phi)Rot(y,theta)Rot(z,psi) - * -*****************************************************************************/ + */ #include #include @@ -154,18 +153,18 @@ vpRzyzVector vpRzyzVector::buildFrom(const std::vector &rzyz) \param v : Angle value to set for each element of the vector. -\code -#include -#include + \code + #include + #include -int main() -{ - vpRzyzVector r; + int main() + { + vpRzyzVector r; - // Initialise the rotation vector - r = vpMath::rad( 45.f); // All the 3 angles are set to 45 degrees -} -\endcode + // Initialise the rotation vector + r = vpMath::rad( 45.f); // All the 3 angles are set to 45 degrees + } + \endcode */ vpRzyzVector &vpRzyzVector::operator=(double v) { @@ -193,23 +192,22 @@ void vpRzyzVector::buildFrom(double phi, double theta, double psi) Copy operator that initializes a \f$R_{zyz}=(\varphi,\theta,\psi)\f$ Euler angles vector from a 3-dimension column vector. - \param rzyz : 3-dimension vector containing the values of the rotation -vector. - -\code -#include + \param rzyz : 3-dimension vector containing the values of the rotation vector. -int main() -{ - vpColVector v(3); - v[0] = 0.1; - v[1] = 0.2; - v[2] = 0.3; - vpRzyxVector rzyz; - rzyz = v; - // rzyz is now equal to v : 0.1, 0.2, 0.3 -} -\endcode + \code + #include + + int main() + { + vpColVector v(3); + v[0] = 0.1; + v[1] = 0.2; + v[2] = 0.3; + vpRzyxVector rzyz; + rzyz = v; + // rzyz is now equal to v : 0.1, 0.2, 0.3 + } + \endcode */ vpRzyzVector &vpRzyzVector::operator=(const vpColVector &rzyz) { @@ -227,17 +225,17 @@ vpRzyzVector &vpRzyzVector::operator=(const vpColVector &rzyz) /*! Set vector from a list of 3 double angle values in radians. \code -#include + #include -int main() -{ - vpRzyzVector rzyz = {M_PI, 0, M_PI_2}; - std::cout << "rzyz: " << rzyz.t() << std::endl; -} + int main() + { + vpRzyzVector rzyz = {M_PI, 0, M_PI_2}; + std::cout << "rzyz: " << rzyz.t() << std::endl; + } \endcode It produces the following printings: \code -rzyz: 3.141592654 0 1.570796327 + rzyz: 3.141592654 0 1.570796327 \endcode \sa operator<<() */ diff --git a/modules/core/src/math/transformation/vpThetaUVector.cpp b/modules/core/src/math/transformation/vpThetaUVector.cpp index d9738d6dba..3f4ae7355a 100644 --- a/modules/core/src/math/transformation/vpThetaUVector.cpp +++ b/modules/core/src/math/transformation/vpThetaUVector.cpp @@ -30,13 +30,11 @@ * * Description: * Theta U parameterization for the rotation. - * -*****************************************************************************/ + */ /*! -\file vpThetaUVector.cpp -\brief class that consider the case of the Theta U parameterization for the -rotation + \file vpThetaUVector.cpp + \brief class that consider the case of the Theta U parameterization for the rotation */ #include // std::fabs @@ -85,17 +83,17 @@ vpThetaUVector::vpThetaUVector(const vpQuaternionVector &q) : vpRotationVector(3 /*! Build a \f$\theta {\bf u}\f$ vector from 3 angles in radians. \code -#include + #include -int main() -{ - vpThetaUVector tu(0, M_PI_2, M_PI); - std::cout << "tu: " << tu.t() << std::endl; -} + int main() + { + vpThetaUVector tu(0, M_PI_2, M_PI); + std::cout << "tu: " << tu.t() << std::endl; + } \endcode It produces the following printings: \code -tu: 0 1.570796327 3.141592654 + tu: 0 1.570796327 3.141592654 \endcode */ vpThetaUVector::vpThetaUVector(double tux, double tuy, double tuz) : vpRotationVector(3) { buildFrom(tux, tuy, tuz); } @@ -273,21 +271,20 @@ vpThetaUVector vpThetaUVector::buildFrom(const vpColVector &tu) Initialize each element of the \f$\theta {\bf u}\f$ vector to the same angle value \e v. - \param v : Angle value to set for each element of the \f$\theta {\bf - u}\f$ vector. + \param v : Angle value to set for each element of the \f$\theta {\bf u}\f$ vector. -\code -#include -#include + \code + #include + #include -int main() -{ - vpThetaUVector tu; + int main() + { + vpThetaUVector tu; - // Initialise the theta U rotation vector - tu = vpMath::rad( 45.f); // All the 3 angles are set to 45 degrees -} -\endcode + // Initialise the theta U rotation vector + tu = vpMath::rad( 45.f); // All the 3 angles are set to 45 degrees + } + \endcode */ vpThetaUVector &vpThetaUVector::operator=(double v) { @@ -300,25 +297,24 @@ vpThetaUVector &vpThetaUVector::operator=(double v) /*! Copy operator that initializes a \f$\theta {\bf u}\f$ vector from a -3-dimension column vector \e tu. + 3-dimension column vector \e tu. - \param tu : 3-dimension vector containing the values of the \f$\theta {\bf -u}\f$ vector. + \param tu : 3-dimension vector containing the values of the \f$\theta {\bf u}\f$ vector. -\code -#include + \code + #include -int main() -{ - vpColVector v(3); - v[0] = 0.1; - v[1] = 0.2; - v[2] = 0.3; - vpThetaUVector tu; - tu = v; - // tu is now equal to v : 0.1, 0.2, 0.3 -} -\endcode + int main() + { + vpColVector v(3); + v[0] = 0.1; + v[1] = 0.2; + v[2] = 0.3; + vpThetaUVector tu; + tu = v; + // tu is now equal to v : 0.1, 0.2, 0.3 + } + \endcode */ vpThetaUVector &vpThetaUVector::operator=(const vpColVector &tu) { @@ -344,18 +340,18 @@ vpThetaUVector &vpThetaUVector::operator=(const vpColVector &tu) The following example shows how to use this function: \code -#include + #include -int main() -{ - vpHomogeneousMatrix M(0, 0, 1., vpMath::rad(10), vpMath::rad(20), vpMath::rad(30)); + int main() + { + vpHomogeneousMatrix M(0, 0, 1., vpMath::rad(10), vpMath::rad(20), vpMath::rad(30)); - double theta; - vpColVector u; - M.getRotationMatrix().getThetaUVector().extract(theta, u); - std::cout << "theta: " << theta << std::endl; - std::cout << "u : " << u.t() << std::endl; -} + double theta; + vpColVector u; + M.getRotationMatrix().getThetaUVector().extract(theta, u); + std::cout << "theta: " << theta << std::endl; + std::cout << "u : " << u.t() << std::endl; + } \endcode \sa getTheta(), getU() @@ -377,21 +373,21 @@ void vpThetaUVector::extract(double &theta, vpColVector &u) const /*! Get the rotation angle \f$ \theta \f$ from the \f$ \theta {\bf u} \f$ -representation. + representation. \return Rotation angle \f$ \theta \f$ in rad. The following example shows how to use this function: \code -#include + #include -int main() -{ - vpHomogeneousMatrix M(0, 0, 1., vpMath::rad(10), vpMath::rad(20), vpMath::rad(30)); + int main() + { + vpHomogeneousMatrix M(0, 0, 1., vpMath::rad(10), vpMath::rad(20), vpMath::rad(30)); - std::cout << "theta: " << M.getRotationMatrix().getThetaUVector().getTheta() << std::endl; - std::cout << "u : " << M.getRotationMatrix().getThetaUVector().getU().t() << std::endl; -} + std::cout << "theta: " << M.getRotationMatrix().getThetaUVector().getTheta() << std::endl; + std::cout << "u : " << M.getRotationMatrix().getThetaUVector().getU().t() << std::endl; + } \endcode \sa getTheta(), extract() @@ -401,22 +397,22 @@ double vpThetaUVector::getTheta() const { return sqrt(data[0] * data[0] + data[1 /*! Get the unit vector \f$\bf u \f$ from the \f$ \theta {\bf u} \f$ -representation. + representation. \return 3-dim unit vector \f${\bf u} = (u_{x},u_{y},u_{z})^{\top} \f$ representing the rotation axis. The following example shows how to use this function: \code -#include + #include -int main() -{ - vpHomogeneousMatrix M(0, 0, 1., vpMath::rad(10), vpMath::rad(20), pMath::rad(30)); + int main() + { + vpHomogeneousMatrix M(0, 0, 1., vpMath::rad(10), vpMath::rad(20), pMath::rad(30)); - std::cout << "theta: " << M.getRotationMatrix().getThetaUVector().getTheta() << std::endl; - std::cout << "u : " << M.getRotationMatrix().getThetaUVector().getU().t() << std::endl; -} + std::cout << "theta: " << M.getRotationMatrix().getThetaUVector().getTheta() << std::endl; + std::cout << "u : " << M.getRotationMatrix().getThetaUVector().getU().t() << std::endl; + } \endcode \sa getTheta(), extract() @@ -471,17 +467,17 @@ vpThetaUVector vpThetaUVector::operator*(const vpThetaUVector &tu_b) const /*! Set vector from a list of 3 double angle values in radians. \code -#include + #include -int main() -{ - vpThetaUVector tu = {M_PI, 0, M_PI_2}; - std::cout << "tu: " << tu.t() << std::endl; -} + int main() + { + vpThetaUVector tu = {M_PI, 0, M_PI_2}; + std::cout << "tu: " << tu.t() << std::endl; + } \endcode It produces the following printings: \code -tu: 3.141592654 0 1.570796327 + tu: 3.141592654 0 1.570796327 \endcode \sa operator<<() */ diff --git a/modules/core/src/math/transformation/vpTranslationVector.cpp b/modules/core/src/math/transformation/vpTranslationVector.cpp index 19767242a8..74a22cfa14 100644 --- a/modules/core/src/math/transformation/vpTranslationVector.cpp +++ b/modules/core/src/math/transformation/vpTranslationVector.cpp @@ -30,8 +30,7 @@ * * Description: * Translation vector. - * -*****************************************************************************/ + */ #include #include @@ -236,7 +235,7 @@ vpTranslationVector vpTranslationVector::operator+(const vpTranslationVector &tv \return The sum of the current translation vector (*this) and the column vector to add. -\code + \code vpTranslationVector t1(1,2,3); vpColVector v(3); v[0] = 4; @@ -510,17 +509,17 @@ vpTranslationVector &vpTranslationVector::operator=(double x) /*! Set vector from a list of 3 double values in meters. \code -#include + #include -int main() -{ - vpTranslationVector t = {0, 0.1, 0.5}; - std::cout << "t: " << t.t() << std::endl; -} + int main() + { + vpTranslationVector t = {0, 0.1, 0.5}; + std::cout << "t: " << t.t() << std::endl; + } \endcode It produces the following printings: \code -t: 0 0.1 0.5 + t: 0 0.1 0.5 \endcode \sa operator<<() */ @@ -544,18 +543,18 @@ vpTranslationVector &vpTranslationVector::operator=(const std::initializer_list< The following example shows how to initialize a translation vector from a list of 3 values [meter]. \code -#include + #include -int main() -{ - vpTranslationVector t; - t << 0, 0.1, 0.5; - std::cout << "t: " << t.t() << std::endl; -} + int main() + { + vpTranslationVector t; + t << 0, 0.1, 0.5; + std::cout << "t: " << t.t() << std::endl; + } \endcode It produces the following printings: \code -t: 0 0.1 0.5 + t: 0 0.1 0.5 \endcode \sa operator,() @@ -574,18 +573,18 @@ vpTranslationVector &vpTranslationVector::operator<<(double val) The following example shows how to initialize a translations vector from a list of 3 values [meter]. \code -#include + #include -int main() -{ - vpTranslationVector t; - t << 0, 0.1, 0.5; - std::cout << "t: " << t.t() << std::endl; -} + int main() + { + vpTranslationVector t; + t << 0, 0.1, 0.5; + std::cout << "t: " << t.t() << std::endl; + } \endcode It produces the following printings: \code -t: 0 0.1 0.5 + t: 0 0.1 0.5 \endcode \sa operator<<() @@ -742,7 +741,7 @@ double vpTranslationVector::frobeniusNorm() const vector t(m). \return The value \f[\sum{i=0}^{m} t_i^{2}\f]. - */ +*/ double vpTranslationVector::sumSquare() const { double sum_square = 0.0;