A vector has a size and a direction. The dot product measures how aligned two vectors are, and the cross product (in 3D) gives a vector perpendicular to both.
Each part of this topic has its own page with the formula, worked examples and a solver: Magnitude of a vector (2D and 3D), Unit vector, Direction of a 2D vector, Scalar product.
A vector has both size and direction. The dot product measures how aligned two vectors are, and the cross product gives a vector perpendicular to both.
Finding the angle between two directions.
Describing forces, velocities and displacements.
Finding a vector perpendicular to a plane.
How to solve it
Magnitude: the square root of the sum of the squared components.
Dot product: multiply matching components and add. It is zero when the vectors are perpendicular.
Angle between vectors: cos θ = (a · b) ÷ (|a||b|).
Cross product: a × b has components (a₂b₃ - a₃b₂, a₃b₁ - a₁b₃, a₁b₂ - a₂b₁).
Unit vector: divide a vector by its magnitude.
Worked examples
The examples marked with a button were worked out by the solver on this page. You can try each one yourself.
Example 1: angle between (1,0,2) and (3,1,1)
Worked out by the solver on this page. Press the button to try it yourself.
Vectors
Answer
θ=47.6∘
Use cosθ=∣a∣∣b∣a⋅b
Dot product
a⋅b=(1)(3)+(0)(1)+(2)(1)=5
Magnitudes
∣a∣=5=2.23607,∣b∣=11=3.31662
Substitute
cosθ=2.23607×3.316625=0.67419986
Inverse cosine
θ=cos−1(0.67419986)=47.6∘
Example 2: dot product of (1,2,3) and (4,5,6)
Worked out by the solver on this page. Press the button to try it yourself.
Vectors
Answer
a⋅b=32
Multiply matching components and add
a⋅b=(1)(4)+(2)(5)+(3)(6)
Evaluate
32
Meaning
The dot product is positive, so the angle between the vectors is acute.
Example 3: cross product of (1,2,3) and (4,5,6)
Worked out by the solver on this page. Press the button to try it yourself.
VectorsAnswer checked
Answer
−36−3
Use a×b=(a2b3−a3b2,a3b1−a1b3,a1b2−a2b1)