Registered Member
|
Hi all,
I have a question on rotations using Quaternions (Q) applied on complex vector (v = Eigen::Vector3cd). Using an Quaternion<double> is not possible because the operation of Q*v is not defined (YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY), however using Quaternion< complex<double> > doubles the required storage, with the unnecessary imaginary part which is zero. Do you have any suggestions on howto proceed without casting to some temporary object? Thanks, Matthias |
Registered Member
|
|
Moderator
|
Indeed, we should allow that. In the meantime you can either apply it twice:
w.real() = A*v.real(); w.imag() = A*v.imag(); or convert it to a real rotation matrix for which mixing real and complex is allowed: Matrix3d R(Q); w = R * v; If you apply R/Q to more than a single vector, then this conversion to a matrix will be faster than applying Q directly. |
Registered Member
|
Thank you very much. I think I will proceed with the conversion to a real matrix
|
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]