Changeset 212 in pacpusframework for trunk


Ignore:
Timestamp:
11/06/13 11:51:51 (11 years ago)
Author:
Marek Kurdej
Message:

Geodesie: minor fixes.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/Pacpus/PacpusTools/geodesie.h

    r211 r212  
    2525#include <vector>
    2626
    27 //#include <QMatrix4x4>
    28 //#include <QVector3D>
     27class QMatrix4x4;
     28class QVector3D;
    2929
    3030namespace Geodesy
     
    211211}
    212212
    213 //PACPUSTOOLS_API QMatrix4x4 yprenuToMatrix(QVector3D angle, QVector3D position);
     213PACPUSTOOLS_API QMatrix4x4 yprenuToMatrix(QVector3D angle, QVector3D position);
    214214
    215215} // namespace Geodesy
  • trunk/src/PacpusTools/src/geodesie.cpp

    r211 r212  
    1010
    1111#include <fstream>
     12#include <QMatrix4x4>
     13#include <QVector3D>
    1214
    1315using ::boost::math::constants::pi;
     
    413415}
    414416
    415 //QMatrix4x4 Geodesy::yprenuToMatrix(QVector3D angle, QVector3D position)
    416 //{
    417 //    float c1 = cos(angle.x());
    418 //    float c2 = cos(angle.y());
    419 //    float c3 = cos(angle.z());
    420 //
    421 //    float s1 = sin(angle.x());
    422 //    float s2 = sin(angle.y());
    423 //    float s3 = sin(angle.z());
    424 //
    425 //    // Source : https://en.wikipedia.org/wiki/Euler_angles
    426 //    return QMatrix4x4(c1 * c2, c1 * s2 * s3 - c3 * s1, s1 * s3 + c1 * c3 * s2, position.x(),
    427 //                      c2 * s1, c1 * c3 + s1 * s2 * s3, c3 * s1 * s2 - c1 * s3, position.y(),
    428 //                      -s2, c2 * s3, c2 * c3, position.z(),
    429 //                      0, 0, 0, 1);
    430 //}
     417QMatrix4x4 Geodesy::yprenuToMatrix(QVector3D angle, QVector3D position)
     418{
     419    float c1 = cos(angle.x());
     420    float c2 = cos(angle.y());
     421    float c3 = cos(angle.z());
     422
     423    float s1 = sin(angle.x());
     424    float s2 = sin(angle.y());
     425    float s3 = sin(angle.z());
     426
     427    // Source : https://en.wikipedia.org/wiki/Euler_angles
     428    return QMatrix4x4(c1 * c2, c1 * s2 * s3 - c3 * s1, s1 * s3 + c1 * c3 * s2, position.x(),
     429                      c2 * s1, c1 * c3 + s1 * s2 * s3, c3 * s1 * s2 - c1 * s3, position.y(),
     430                      -s2, c2 * s3, c2 * c3, position.z(),
     431                      0, 0, 0, 1);
     432}
Note: See TracChangeset for help on using the changeset viewer.