Type to search, in English or Thai

  1. Home
  2. Articles
  3. Vectors & Linear Algebra
  4. Dot vs cross product

// Article · Vectors

Dot Product vs Cross Product: Formulas, Meaning and Examples

Two vectors can be multiplied in two ways. The first gives a number; the second gives a new vector. Both have clear physical meanings: the dot product is used for work and angles, while the cross product is used for torque and area.

By Ajarn ModUpdated
30-second summary
  • Dot: a⋅b=∣a∣∣b∣cos⁡θ=axbx+ayby+azbz\mathbf{a}\cdot\mathbf{b}=|\mathbf{a}||\mathbf{b}|\cos\theta=a_xb_x+a_yb_y+a_zb_z → scalar
  • Cross: ∣a×b∣=∣a∣∣b∣sin⁡θ|\mathbf{a}\times\mathbf{b}|=|\mathbf{a}||\mathbf{b}|\sin\theta → vector perpendicular to both, direction by the right-hand rule
  • Dot = 0 ⇒ perpendicular · Cross = 0 ⇒ parallel

A short comparison

Dot product a⋅b\mathbf{a}\cdot\mathbf{b}Cross product a×b\mathbf{a}\times\mathbf{b}
ResultScalarVector (3D)
Formula with the angle∣a∣∣b∣cos⁡θ|\mathbf{a}||\mathbf{b}|\cos\thetaMagnitude ∣a∣∣b∣sin⁡θ|\mathbf{a}||\mathbf{b}|\sin\theta
Formula with componentsaxbx+ayby+azbza_xb_x+a_yb_y+a_zb_zDeterminant with i,j,k\mathbf{i},\mathbf{j},\mathbf{k}
Geometric meaningProjection of one vector onto the other × lengthArea of the parallelogram the two vectors span
Swapping the orderUnchangedSign reverses
Equals zero whenPerpendicularParallel
Used to findWork, angle, projection, real powerTorque, magnetic force, a perpendicular direction

Dot product (scalar product)

For a=(ax,ay,az)\mathbf{a}=(a_x,a_y,a_z) and b=(bx,by,bz)\mathbf{b}=(b_x,b_y,b_z), multiply the components along the same axis and add them.

a⋅b=axbx+ayby+azbz=∣a∣∣b∣cos⁡θ\mathbf{a}\cdot\mathbf{b}=a_xb_x+a_yb_y+a_zb_z=|\mathbf{a}||\mathbf{b}|\cos\theta

So the angle between the vectors follows from cos⁡θ=a⋅b∣a∣∣b∣\cos\theta=\dfrac{\mathbf{a}\cdot\mathbf{b}}{|\mathbf{a}||\mathbf{b}|}. A positive value means an acute angle, a negative value an obtuse angle.

Work example

A 50 N force at 30° to a 4 m displacement

  1. W=F⋅d=∣F∣∣d∣cos⁡θ=50×4×cos⁡30∘W=\mathbf{F}\cdot\mathbf{d}=|\mathbf{F}||\mathbf{d}|\cos\theta=50\times4\times\cos30^\circ

W=200×0.866≈173.2W = 200\times0.866 \approx 173.2 J (only the component of the force parallel to the displacement does work)

Cross product (vector product)

The result is perpendicular to both a\mathbf{a} and b\mathbf{b}, with direction given by the right-hand rule: point your fingers along a\mathbf{a} and curl them toward b\mathbf{b}; your thumb points in the direction of a×b\mathbf{a}\times\mathbf{b}. With components it is calculated as follows.

a×b=∣ijkaxayazbxbybz∣=(aybz−azby) i−(axbz−azbx) j+(axby−aybx) k\mathbf{a}\times\mathbf{b}=\begin{vmatrix}\mathbf{i}&\mathbf{j}&\mathbf{k}\\a_x&a_y&a_z\\b_x&b_y&b_z\end{vmatrix}=(a_yb_z-a_zb_y)\,\mathbf{i}-(a_xb_z-a_zb_x)\,\mathbf{j}+(a_xb_y-a_yb_x)\,\mathbf{k}
Torque example

A 0.3 m wrench with a 100 N force perpendicular to the handle

  1. τ=r×F,∣τ∣=rFsin⁡90∘=0.3×100×1\boldsymbol{\tau}=\mathbf{r}\times\mathbf{F},\quad |\boldsymbol{\tau}|=rF\sin90^\circ=0.3\times100\times1

∣τ∣=30|\boldsymbol{\tau}|=30 N·m, with the torque direction along the axis of rotation of the nut. If the force is applied at a slant, the torque falls in proportion to sin⁡θ\sin\theta.

The same example, computed both ways

Let a=(2,3,1)\mathbf{a}=(2,3,1) and b=(1,−1,4)\mathbf{b}=(1,-1,4).

  1. Dot product

    a⋅b=2(1)+3(−1)+1(4)=3\mathbf{a}\cdot\mathbf{b}=2(1)+3(-1)+1(4)=3
  2. Cross product

    a×b=(3⋅4−1⋅(−1),  1⋅1−2⋅4,  2⋅(−1)−3⋅1)=(13, −7, −5)\mathbf{a}\times\mathbf{b}=\big(3\cdot4-1\cdot(-1),\; 1\cdot1-2\cdot4,\; 2\cdot(-1)-3\cdot1\big)=(13,\,-7,\,-5)
  3. The angle between the vectors, with ∣a∣=14|\mathbf{a}|=\sqrt{14}, ∣b∣=18|\mathbf{b}|=\sqrt{18}

    cos⁡θ=31418≈0.189  ⇒  θ≈79.1∘\cos\theta=\frac{3}{\sqrt{14}\sqrt{18}}\approx0.189\;\Rightarrow\;\theta\approx79.1^\circ
  4. Check with the magnitude of the cross product, which must equal ∣a∣∣b∣sin⁡θ|\mathbf{a}||\mathbf{b}|\sin\theta

    ∣a×b∣=132+72+52=243≈15.59|\mathbf{a}\times\mathbf{b}|=\sqrt{13^2+7^2+5^2}=\sqrt{243}\approx15.59

14×18 sin⁡79.1∘≈15.87×0.982≈15.59\sqrt{14\times18}\,\sin79.1^\circ\approx15.87\times0.982\approx15.59 ✓ and a⋅(a×b)=2(13)+3(−7)+1(−5)=0\mathbf{a}\cdot(\mathbf{a}\times\mathbf{b})=2(13)+3(-7)+1(-5)=0 ✓ (the cross product is perpendicular to a\mathbf{a})

How it is used in electrical engineering

  • Real power: treating the voltage and current phasors (RMS values) as vectors in a 2D plane, the real power P=VIcos⁡φP=VI\cos\varphi is their dot product.
  • Force on a conductor: F=I L×B\mathbf{F}=I\,\mathbf{L}\times\mathbf{B} and the Lorentz force F=q v×B\mathbf{F}=q\,\mathbf{v}\times\mathbf{B} are cross products.
  • Motor torque: τ=r×F\boldsymbol{\tau}=\mathbf{r}\times\mathbf{F}.

Keep learning in the library

The full lessons are in Thai, with English technical terms and the same formulas.

Frequently asked questions

How do the results of the dot product and cross product differ?

The dot product gives a scalar (a single number). The cross product gives a vector perpendicular to both vectors, with its direction given by the right-hand rule. The cross product is defined only for 3D vectors.

What does it mean if the dot product is zero?

The two vectors are perpendicular (when neither is the zero vector). For example, a force perpendicular to the motion does zero work.

What does it mean if the cross product is the zero vector?

The two vectors are parallel or lie along the same line, because sin⁡θ=0\sin\theta = 0.

Why does the sign change when you swap the order of a cross product?

Because the direction of the result is set by the right-hand rule. Swapping the order, b×a\mathbf{b}\times\mathbf{a}, reverses the direction, so b×a=− a×b\mathbf{b}\times\mathbf{a}=-\,\mathbf{a}\times\mathbf{b}. The dot product is commutative.

All 7 articles in Vectors & Linear Algebra → · All articles