Discussion:
[eigen] cross product with complex vectors
Orell Garten
2018-07-16 11:35:33 UTC
Permalink
Hi

I was wondering whether the implementation of the cross product for
complex vectors [1] is correct.

Assume I have two vectors of type Vector3cd which hold a=(0,0,1) and
b=(0,1+i,0). I do a.cross(b) and would expect to get (-1-i,0,0) but get
(-1+i,0,0) as a result.

I think the formula in [1] should be (a + ib) x (c x id) = (a x c - b x
d) + i (a x d + b x c) but maybe I am wrong.

It would be great if somebody could provide some sanity check or the
reasoning behind [1].

Thanks for helping,
Orell

[1]
http://eigen.tuxfamily.org/dox/group__Geometry__Module.html#ga0024b44eca99cb7135887c2aaf319d28
Christoph Hertzberg
2018-07-16 11:53:59 UTC
Permalink
Here is a related bugzilla entry:

http://eigen.tuxfamily.org/bz/show_bug.cgi?id=944

Short story: We can't just change our API here, but you can use this as
a workaround:

a.cross(b.conjugate());


Christoph
Post by Orell Garten
Hi
I was wondering whether the implementation of the cross product for
complex vectors [1] is correct.
Assume I have two vectors of type Vector3cd which hold a=(0,0,1) and
b=(0,1+i,0). I do a.cross(b) and would expect to get (-1-i,0,0) but get
(-1+i,0,0) as a result.
I think the formula in [1] should be (a + ib) x (c x id) = (a x c - b x
d) + i (a x d + b x c) but maybe I am wrong.
It would be great if somebody could provide some sanity check or the
reasoning behind [1].
Thanks for helping,
Orell
[1]
http://eigen.tuxfamily.org/dox/group__Geometry__Module.html#ga0024b44eca99cb7135887c2aaf319d28
--
Dr.-Ing. Christoph Hertzberg

Besuchsadresse der Nebengeschäftsstelle:
DFKI GmbH
Robotics Innovation Center
Robert-Hooke-Straße 5
28359 Bremen, Germany

Postadresse der Hauptgeschäftsstelle Standort Bremen:
DFKI GmbH
Robotics Innovation Center
Robert-Hooke-Straße 1
28359 Bremen, Germany

Tel.: +49 421 178 45-4021
Zentrale: +49 421 178 45-0
E-Mail: ***@dfki.de

Weitere Informationen: http://www.dfki.de/robotik
-----------------------------------------------------------------------
Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH
Firmensitz: Trippstadter Straße 122, D-67663 Kaiserslautern
Geschaeftsfuehrung: Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster
(Vorsitzender) Dr. Walter Olthoff
Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes
Amtsgericht Kaiserslautern, HRB 2313
Sitz der Gesellschaft: Kaiserslautern (HRB 2313)
USt-Id.Nr.: DE 148646973
Steuernummer: 19/672/50006
-----------------------------------------------------------------------
Orell Garten
2018-07-16 12:53:50 UTC
Permalink
Thanks for the quick answer. That helps for "mixed" vectors, if one does
not have an imaginary part.

Orell
Post by Christoph Hertzberg
http://eigen.tuxfamily.org/bz/show_bug.cgi?id=944
Short story: We can't just change our API here, but you can use this as
  a.cross(b.conjugate());
Christoph
Post by Orell Garten
Hi
I was wondering whether the implementation of the cross product for
complex vectors [1] is correct.
Assume I have two vectors of type Vector3cd which hold a=(0,0,1) and
b=(0,1+i,0). I do a.cross(b) and would expect to get (-1-i,0,0) but get
(-1+i,0,0) as a result.
I think the formula in [1] should be (a + ib) x (c x id) = (a x c - b x
d) + i (a x d + b x c) but maybe I am wrong.
It would be great if somebody could provide some sanity check or the
reasoning behind [1].
Thanks for helping,
Orell
[1]
http://eigen.tuxfamily.org/dox/group__Geometry__Module.html#ga0024b44eca99cb7135887c2aaf319d28
Gael Guennebaud
2018-07-16 15:09:00 UTC
Permalink
On Mon, Jul 16, 2018 at 3:39 PM Orell Garten <
Post by Orell Garten
Hi
I was wondering whether the implementation of the cross product for
complex vectors [1] is correct.
Assume I have two vectors of type Vector3cd which hold a=(0,0,1) and
b=(0,1+i,0). I do a.cross(b) and would expect to get (-1-i,0,0) but get
(-1+i,0,0) as a result.
I think the formula in [1] should be (a + ib) x (c x id) = (a x c - b x
d) + i (a x d + b x c) but maybe I am wrong.
It would be great if somebody could provide some sanity check or the
reasoning behind [1].
For instance, see:
https://math.stackexchange.com/questions/129227/cross-product-in-complex-vector-spaces

gael
Post by Orell Garten
Thanks for helping,
Orell
[1]
http://eigen.tuxfamily.org/dox/group__Geometry__Module.html#ga0024b44eca99cb7135887c2aaf319d28
Loading...