4 Dimensional crossproduct?

Started by
6 comments, last by Sander 20 years, 6 months ago
I''m working on my little math lib right now. I have 3 vector types: float2, float3 and float4 for 2D, 3D and 4D vectors. I know how to do the crossproduct for 2D and 3D vectors but how do I perform them on 4D vectors?? Ir should I not even bother with that? Sander Maréchal [Lone Wolves Game Development][RoboBlast][Articles][GD Emporium][Webdesign][E-mail]

<hr />
Sander Marechal<small>[Lone Wolves][Hearts for GNOME][E-mail][Forum FAQ]</small>

Advertisement
http://www.flipcode.com/cgi-bin/msg.cgi?showThread=COTD-VectQuat&forum=cotd&id=-1
You need to compute the determinant of a 4x4 matrix.
Check the determinant defined there and extends it to any dimensions :

http://mathworld.wolfram.com/CrossProduct.html
http://www.ucl.ac.uk/Mathematics/geomath/level2/mat/mat121.html

Use a good algorithm to compute the determinant, a bad algo may be very slow with large matrices.
The short answer is "don''t bother". In more detail there are two interpretations of a "4D cross product".

One is that you are using 4D homogeneous coordinates to represent 3D points. If so your 3D cross product will be all you will need, along with a way of getting from 4D to 3D vectors before doing the product.

The second is that you are doing 4D geometry. If so there is no cross product in 4D, if such is defined as "a bilinear product between two vectors with a vector result". It has been mathematically proven that such products only exist in 3 and 7 dimensions. Apart from the dot product there are other interesting products of vectors in 4D, but you won''t want to bother with them until you move far beyond 4D vectors.
John BlackburneProgrammer, The Pitbull Syndicate
This is the third thread that is on the forum screen now where someone has either asked about multidimensional cross products or discusses it. In short:

A cross product of k vectors is defined in k+1 dimensional space. So, for a cross product in two dimensions, you need one vector. In 3D, you need two vectors, 4D you need 3 vectors and so forth.

In 2D, you find a vector perpendicular to a line in 2D space, in 3D you find the vector perpendicular to a plane in 3D space, so, in 4D I presume you find the vector perpendicular to a 3D volume in 4D space.

The cross product of two vectors is only defined in 3D and 7D, though, cross products in general extend to any dimension.

You have to remember that you''re unique, just like everybody else.
If at first you don't succeed, redefine success.
Thanks all. In that case, I won''t bother. I just asked for the sake of completeness since both float2 and float3 have a cross product defined (in 2D it returns a positive or negiative float) but I really don''t see any use for 4D cross-product between 3 vectors.

Sander Maréchal
[Lone Wolves Game Development][RoboBlast][Articles][GD Emporium][Webdesign][E-mail]

<hr />
Sander Marechal<small>[Lone Wolves][Hearts for GNOME][E-mail][Forum FAQ]</small>

the cross product has geometric meaning in the 3rd and 7th dimensions only...but i can't tell you why

edit: hmm, should read other posts before posting

[edited by - sjelkjd on September 20, 2003 2:03:03 PM]
3D : xi = aj * bk * e(i,j,k), e(i,j,k) being the totally antisymmetric pseudo-tensor.
4D : xi = aj * bk * cl * e(i,j,k,l)
xD : I think you can guess it.

4D-two vectors: xij = ak * bl * e(i,j,k,l); the vectors in xij are a (lineary dependent) base of the space perpendicular to a and b.

xD - n vectors: Guess it.

Above equations assume a orthonomral base in a flat space with the euclidean scalar product (a*b = ai * bi). A possible generalisation would be taking another scalar or pseudo-scalar product that would be a*b = aAb with A being non-singluar. In that case you can simply define the vector-product by adding A^-1 to above equations.

The (generalized) vector product defined above has almost all of the properties the "normal" vector product has: It´s multilinear and alternating (both properties of the e-pseudo-tensor) and the result is the creates the space that is perpendicular to the vectors you applied it to.

It´s very easy to prove that but it defenitely lacks one thing: I´ve held a speech about that some 4 years ago and still didn´t meet any application for it. Maybe someone knows of one and can tell me that here.

This topic is closed to new replies.

Advertisement