Changeset 99 in pacpusframework for branches/2.0-beta1/src/PacpusTools


Ignore:
Timestamp:
May 28, 2013, 5:55:14 PM (11 years ago)
Author:
morasjul
Message:

Add function Geodesie::yprenuToMatrix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0-beta1/src/PacpusTools/src/geodesie.cpp

    r89 r99  
    343343    C.Apply(x,y,z, e,n,u);
    344344}
     345
     346QMatrix4x4 Geodesie::yprenuToMatrix(QVector3D angle, QVector3D position) {
     347
     348    float c1 = cos(angle.x());
     349    float c2 = cos(angle.y());
     350    float c3 = cos(angle.z());
     351
     352    float s1 = sin(angle.x());
     353    float s2 = sin(angle.y());
     354    float s3 = sin(angle.z());
     355
     356
     357    // Source : https://en.wikipedia.org/wiki/Euler_angles
     358    return QMatrix4x4 (  c1*c2, c1*s2*s3-c3*s1, s1*s3+c1*c3*s2, position.x(),
     359                         c2*s1, c1*c3+s1*s2*s3, c3*s1*s2-c1*s3, position.y(),
     360                           -s2,          c2*s3,          c2*c3, position.z(),
     361                             0,              0,              0,          1);
     362}
Note: See TracChangeset for help on using the changeset viewer.