This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Rotation of complex vector

Tags: None
(comma "," separated)
matthiasw
Registered Member
Posts
6
Karma
0

Rotation of complex vector

Fri May 08, 2015 4:16 pm
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
aluaces
Registered Member
Posts
13
Karma
0
OS

Re: Rotation of complex vector

Fri May 15, 2015 2:23 pm
Sorry, wrong thread...
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: Rotation of complex vector  Topic is solved

Mon May 25, 2015 8:45 pm
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.
matthiasw
Registered Member
Posts
6
Karma
0

Re: Rotation of complex vector

Fri Jun 05, 2015 12:29 pm
Thank you very much. I think I will proceed with the conversion to a real matrix


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]