Adam Lee
Adam Lee

Reputation: 25768

what is the geometry meaning of 2D cross product?

I have two 2D vectors, like [x1,y1] and [x2,y2]

Some guys define 2d Cross as x1*y2 - y1 * x2

I am wondering what's the meaning of this? Any practical application?

Upvotes: 5

Views: 5633

Answers (2)

Codie CodeMonkey
Codie CodeMonkey

Reputation: 7946

"2D cross products" are more properly called 2d wedge products. Wedge products generalize to other dimensions, but cross products are always 3d wedge products. The usual operator symbol for a wedge product is ^.

You can use 2d wedge products to determine if one vector is to the left or the right of another one. If vector A is to the right of vector B, then A ^ B > 0, if A is to the left A ^ B < 0. If they are parallel or either of them is 0, then A ^ B = 0.

        | Ax Ay |
A ^ B = | Bx By | = Ax By - Ay Bx

In vector graphics, 2d wedge products can be used to analyze the intersection of 2 parametrized curves, e.g. for removing portions of one curve that lies to the right of another. If you have a region defined by a set of bounding curves oriented counterclockwise around the interior of the region, you can then clip a set of curves to the boundary by trimming off the pieces that are to the right of their intersection with a boundary curve.

Upvotes: 8

Sneftel
Sneftel

Reputation: 41522

Codie's answer is a good one. I will also note that the "2D cross product" is also commonly referred to as the "perpendicular dot product" or "perp dot product": the dot product of the CCW perpendicular of A with the (original) B. By "CCW perpendicular", I mean the vector 90 degrees counterclockwise; the CCW perpendicular of (x, y) is (-y, x).

Upvotes: 2

Related Questions