Mathwords logoMathwords

Perp Dot Product — Definition, Formula & Example

The perp dot product is a single number computed from two 2D vectors. Its sign tells you whether the second vector turns left (counterclockwise) or right (clockwise) from the first, and its absolute value equals the area of the parallelogram the two vectors span.

For a=(ax,ay)\mathbf{a} = (a_x, a_y) and b=(bx,by)\mathbf{b} = (b_x, b_y) in R2\mathbb{R}^2, let a⊥=(−ay,ax)\mathbf{a}^{\perp} = (-a_y, a_x) be a\mathbf{a} rotated 90∘90^\circ counterclockwise. The perp dot product is the scalar a⊥⋅b=axby−aybx=det⁡(axbxayby)\mathbf{a}^{\perp} \cdot \mathbf{b} = a_x b_y - a_y b_x = \det\begin{pmatrix} a_x & b_x \\ a_y & b_y \end{pmatrix}. It equals ∣a∣ ∣b∣sin⁡θ|\mathbf{a}|\,|\mathbf{b}|\sin\theta, where θ\theta is the signed angle from a\mathbf{a} to b\mathbf{b}, measured counterclockwise. It is anticommutative: b⊥⋅a=−(a⊥⋅b)\mathbf{b}^{\perp} \cdot \mathbf{a} = -(\mathbf{a}^{\perp} \cdot \mathbf{b}). It also equals the zz-component of the cross product (ax,ay,0)×(bx,by,0)(a_x, a_y, 0) \times (b_x, b_y, 0).

Key Formula

a⊥⋅b=axby−aybx=∣a∣ ∣b∣sin⁡θ\mathbf{a}^{\perp} \cdot \mathbf{b} = a_x b_y - a_y b_x = |\mathbf{a}|\,|\mathbf{b}|\sin\theta
Where:
  • a⊥\mathbf{a}^{\perp} = The vector a rotated 90° counterclockwise, equal to (−ay,ax)(-a_y, a_x)
  • ax,aya_x, a_y = Components of the first vector a
  • bx,byb_x, b_y = Components of the second vector b
  • θ\theta = Signed angle from a to b, positive when measured counterclockwise

Worked Example

Problem: Let a = (4, 1) and b = (2, 3). Find the perp dot product a⊥⋅b\mathbf{a}^{\perp} \cdot \mathbf{b}. Use it to decide whether b lies counterclockwise or clockwise from a, and find the area of the parallelogram the vectors span.
Step 1: Rotate a by 90° counterclockwise. Swap the components and negate the new first one.
a⊥=(−ay, ax)=(−1, 4)\mathbf{a}^{\perp} = (-a_y,\ a_x) = (-1,\ 4)
Step 2: Take the ordinary dot product of a⊥\mathbf{a}^{\perp} with b\mathbf{b}. You get the same result from the shortcut axby−aybxa_x b_y - a_y b_x.
a⊥⋅b=(−1)(2)+(4)(3)=10and(4)(3)−(1)(2)=10\mathbf{a}^{\perp} \cdot \mathbf{b} = (-1)(2) + (4)(3) = 10 \quad\text{and}\quad (4)(3) - (1)(2) = 10
Step 3: Read the result. The value is positive, so sin θ > 0 and b is counterclockwise from a. The absolute value is the parallelogram's area. Reversing the order flips the sign.
b⊥⋅a=(2)(1)−(3)(4)=−10\mathbf{b}^{\perp} \cdot \mathbf{a} = (2)(1) - (3)(4) = -10
Answer: a⊥⋅b=10\mathbf{a}^{\perp} \cdot \mathbf{b} = 10. Because the value is positive, b lies counterclockwise from a. The parallelogram spanned by a and b has an area of 10 square units.

Why It Matters

In computer graphics and game programming, the sign of the perp dot product tells you whether a point lies to the left or right of a line. It is also the core step in segment-intersection tests and in finding polygon orientation. The shoelace formula gives a polygon's area as half the sum of the perp dot products of consecutive vertices.

Common Mistakes

Mistake: Writing aybx−axbya_y b_x - a_x b_y, or using the clockwise rotation (ay,−ax)(a_y, -a_x), and then reading the sign as usual.
Correction: Either change flips the sign and reverses your left/right conclusion. Use a⊥=(−ay,ax)\mathbf{a}^{\perp} = (-a_y, a_x) and compute axby−aybxa_x b_y - a_y b_x. Keep the order fixed, because b⊥⋅a=−(a⊥⋅b)\mathbf{b}^{\perp} \cdot \mathbf{a} = -(\mathbf{a}^{\perp} \cdot \mathbf{b}).

Related Terms