Jump to content
  • Advertisement
Sign in to follow this  
Endar

Cross product of 2d vectors

This topic is 4904 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Last night, I was wondering how I get an equation for the cross product of 2 2d vectors. But, I'm a little confused. See, with 3d vectors, I put them into a matrix and found it: -- -- | x y z | | Ax Ay Az | | Bx By Bz | -- -- Where A and B are 3d vectors, the determinant for x is the x vector component for the corss product of the two, the determinant for y, etc, etc. But I'm a little confused how to do it for 2d vectors. -- -- | x y | | Ax Ay | | Bx By | -- -- Because I only learnt how to do the determinant in 3d, I'm a little lost. Would the cross product equation be: (Ay - By), (Ax - Bx) ? Or am I real far off the track?

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by happybara
mathwolrd says:
for two 2d vectors U=(Ux,Uy) V=(Vx,Vy)
the crossproduct is
U x V = Ux*Vy-Uy*Vx



Okay, maybe I'm missing something here, but doens't a cross product between two vectors with the same number of components give you another vector with that number of components?

Share this post


Link to post
Share on other sites
Quote:

Okay, maybe I'm missing something here, but doens't a cross product between two vectors with the same number of components give you another vector with that number of components?

In 3D only. In other dimensions, cross product is not well defined, but there is well-defined analogs.

In any other number of dimensions >=2, there's at least 2 different cross-product "analogs", depending to what properties of 3D cross product we want it to mimic. And 3D is just only special case when both things is the same... and there's many other useful functions possible, that is somewhat like cross product...

In 2D,
CrossProductAnalog1(U,V)=(U.x*V.y-U.y*V.x)
CrossProductAnalog2(U)=(U.y, -U.x)
(yes, second analog takes only one argument, and return orthogonal vector :)
First analog makes some physical and geometrical sense, second analog comes from "determinant rule", for determinant of 2x2 matrix,
|A B|
|C D| = AD-BC


And in 4D, there is one analog that takes 2 4D vectors at input and return 6D vector as result. And other analog that takes 3 4D vectors, and have 4D vector as result. (3 vectors is necessary to define volume, and returned result is "normal of that volume" [grin])

Also, in 3D we can define another nice operation that takes 3 vectors at inputs, and return scalar, and is eqivalent to first 2D cross product analog.

SomeFunction(A,B,C)=(A x B . C)
- return volume of paralelepiped(sp?)
(note that order of operands does not matter...)

in summary,
1: 2D cross product is not defined by itself. In general, there's several analogs, and no analogs is completely equivalent.

2: you can define whatever function you *really* need and can use, and then use it.
3:It is not useful to make cross product routine if you don't know it's properties.

Also, "analog" doesn't really have any mathematical sense, just some properties is somewhat similar.

[Edited by - Dmytry on December 22, 2004 5:06:18 AM]

Share this post


Link to post
Share on other sites
my 0.02 cents is that the cross product can be considered with an alternating covariant n-tensor (n-form), I believe. In this sense it can be defined in n-space always to return a single n-dimensional vector.

C.

Share this post


Link to post
Share on other sites
In general, for an n-dimensional cross product, you need n - 1 vectors (so that the vector orthogonal to them all can be found. For 3 dimensions, this makes it look nice since you have only two operands. Note that this is also implemented in Mathematica this way.

Using the 2D cross product where you get (U.x*V.y-U.y*V.x) is just like doing a 3D one where the Z components are 0. However, the generalized definition does indeed give you (U.y, -U.x).

Share this post


Link to post
Share on other sites
yeah its kinda weird that its so badly defined.
Quote:
Original post by Puzzler183
In general, for an n-dimensional cross product, you need n - 1 vectors (so that the vector orthogonal to them all can be found. For 3 dimensions, this makes it look nice since you have only two operands. Note that this is also implemented in Mathematica this way.

thats the definition i prefer also. its nice and consistent. the crossproduct returns a vector ortogonal to all n-1 input vectors. doesnt get any better imho.

Quote:

Using the 2D cross product where you get (U.x*V.y-U.y*V.x) is just like doing a 3D one where the Z components are 0. However, the generalized definition does indeed give you (U.y, -U.x).

this other definiton makes little sense to me. the only reason for its existance seems to be the irrational need for two operands, like were used to in 3d. but making this the definition for crossproduct in 2d is useless, because youre just giving another name to an already existing procedure: finding the span/calculating the determinant of a set of vectors. it has the same definition.

Share this post


Link to post
Share on other sites
SomeFunction(A,B,C)=(A x B . C)
- return volume of paralelepiped(sp?)
(note that order of operands does not matter...)


Dmytry: by 'SomeFunction', you mean 'determinant' right? :)
And operand order doesn't matter, as long as they keep the same winding... i.e. dat(A,B,C) == det(B,C,A) != det(C,B,A)

Share this post


Link to post
Share on other sites
Quote:
Original post by ajas95
SomeFunction(A,B,C)=(A x B . C)
- return volume of paralelepiped(sp?)
(note that order of operands does not matter...)


Dmytry: by 'SomeFunction', you mean 'determinant' right? :)
And operand order doesn't matter, as long as they keep the same winding... i.e. dat(A,B,C) == det(B,C,A) != det(C,B,A)

yes, determinant of course.
i'd say more,
dat(A,B,C) == det(B,C,A) == -det(C,B,A)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!