コード例 #1
0
ファイル: Quaternion2.cpp プロジェクト: dtbinh/TestRep
Quaternion2 Quaternion2::DecomposeRotation2(const VectorR3 vB) const {
    //we need to compute v in A's coordinates
    VectorR3 vA = this->rotate(vB);
    vA.Normalize();

    double temp = 0;

    //compute the rotation that aligns the vector v in the two coordinate frames (A and T)
    VectorR3 rotAxis = vA * vB;
    rotAxis.Normalize();
    double rotAngle = -safeACOS(vA.Dot(vB));

    Quaternion2 TqA = getRotationQuaternion2(rotAngle, rotAxis*(-1));
    return TqA * (*this);
}