Cross Product (2D)

In 2D the cross product is the signed area of the parallelogram the two vectors make.

a × b = a₁b₂ − a₂b₁ (2D)

With the y-axis pointing up it is positive when b is to the left of a, negative to the right and zero when they line up.

In 3D the cross product is a vector perpendicular to both, used to find surface normals.

Calculator

Change a value and the result and picture update instantly.

Result

Cross product (signed area)5

Animated picture

The picture follows your values. Some points and shapes can be dragged.

Use in game development

Which side of a line is a point on? Is a polygon clockwise? How big is a triangle? The cross product answers all three.

Code example (JavaScript)

const side = ax * by - ay * bx; // > 0: b is to the left of a (y up)

What the symbols mean

SymbolMeaning
axa: x
aya: y
bxb: x
byb: y
crossCross product (signed area)

More formulas in this category

Frequently asked questions

What is the formula for Cross Product (2D)?
The formula for Cross Product (2D) is a × b = a₁b₂ − a₂b₁ (2D). In 2D the cross product is the signed area of the parallelogram the two vectors make.

Math Formula Quiz Vectors & Matrices

Sources

Checked: 2026-11-29