Dot Product, Cross Product, and Projection: Which to Use?
Choose the right vector formula for angles, areas, perpendicular vectors, and projections, with solved examples, sign checks, and practice answers.
- 12th
You know the formulas. Then a question asks for the projection of one vector on another, and suddenly the denominators all look familiar. Do you divide by a magnitude, divide by its square, or find a cross product first?
The way out is to decide what your answer should represent before doing any arithmetic.
A dot product measures alignment. A cross product gives a perpendicular vector whose magnitude measures area. A projection extracts the part of one vector along a chosen direction. These ideas are connected, but they answer different questions.
This guide uses small, original examples to show how to make that choice, handle negative projections, and check your work without repeating the entire calculation.
Start With the Answer the Question Wants
| What the question asks | Start with | What you finally report |
|---|---|---|
| Angle between two nonzero vectors | Dot product | An angle |
| Are two nonzero vectors perpendicular? | Dot product equals zero | A conclusion or parameter value |
| Component along a given direction | Scalar projection | A signed number |
| Vector component along another vector | Vector projection | A vector |
| A vector perpendicular to both given vectors | Cross product | A nonzero vector, if available |
| Area of a parallelogram or triangle | Cross-product magnitude | A nonnegative area |
| Are two nonzero vectors parallel? | Cross product equals zero vector | A conclusion or parameter value |
Notice that an area is a scalar even though you use a vector product to find it. You calculate the cross product first, then take its magnitude.
Likewise, an angle is not the dot product itself. The dot product helps you calculate the cosine of that angle.
A Short Notation Guide
We write a vector as a = (a1, a2, a3). This means the same thing as a1 i + a2 j + a3 k, where i, j, and k are unit vectors along the coordinate axes.
Its magnitude is:
|a| = sqrt(a1^2 + a2^2 + a3^2)
Here, sqrt means square root. The dot symbol · means dot product, while × means cross product. A number multiplying a vector scales each of its components.
For example, if a = (2, -1, 2), then:
|a| = sqrt(4 + 1 + 4) = 3
The unit vector in its direction is:
a/|a| = (2/3, -1/3, 2/3)
A unit vector keeps the direction but has magnitude one. You cannot create a unit vector by dividing the zero vector by its magnitude, because that would involve division by zero.
Dot Product: How Much Do the Directions Agree?
For two vectors in component form:
a · b = a1b1 + a2b2 + a3b3
For nonzero vectors making an angle theta between 0 and 180 degrees:
a · b = |a||b| cos(theta)
The answer is a scalar. No i, j, or k remains.
This immediately gives three useful clues:
- A positive dot product means the angle is between 0 degrees inclusive and 90 degrees exclusive.
- A zero dot product means the nonzero vectors are perpendicular.
- A negative dot product means the angle is greater than 90 degrees and at most 180 degrees.
The endpoint cases describe vectors pointing in exactly the same or exactly opposite directions.
The definitions and basic product rules are covered in NCERT’s Vector Algebra chapter.
Example 1: Find an angle without guessing the formula
Let a = (1, 2, 2) and b = (2, 1, -2).
First calculate the dot product:
a · b = 1(2) + 2(1) + 2(-2) = 0
Both magnitudes are 3, so:
cos(theta) = 0/(3 × 3) = 0
The angle is 90 degrees.
The component calculation gave the scalar 0. The question wanted an angle, so the last sentence is part of the answer.
Example 2: A negative dot product
Let p = (1, 1, 0) and q = (-2, 0, 0).
p · q = -2
|p| = sqrt(2) and |q| = 2
Therefore:
cos(theta) = -2/[2sqrt(2)] = -1/sqrt(2)
The angle is 135 degrees.
If you remove the minus sign, you get 45 degrees and change the answer. For the angle between directed vectors, use the signed dot product. Some questions about the acute angle between undirected lines use an absolute value; that is a different instruction.
Example 3: Find a parameter for perpendicularity
Suppose a = (k, 2, -1) and b = (3, -1, 4) are perpendicular.
a · b = 0
3k - 2 - 4 = 0
k = 2
Check using the resulting vectors:
(2, 2, -1) · (3, -1, 4) = 6 - 2 - 4 = 0
There is no need to find either magnitude here. The perpendicularity condition already answers the question.
Projection: The Part Along a Chosen Direction
Imagine a diagonal walk across a courtyard. Your whole displacement is one vector. Its eastward component tells you how much of that journey contributes to movement along the east-west direction.
Projection makes that separation precise. The direction you project onto is the reference direction.
For projection of a onto a nonzero vector b, begin with the unit direction b/|b|.
Scalar projection: a signed component
Scalar projection of a onto b = (a · b)/|b|
Equivalently, it is |a| cos(theta).
The denominator belongs to b, because b supplies the reference direction. A negative result means the component points against the chosen positive direction of b.
Vector projection: the component with direction attached
Multiply the signed scalar component by the unit vector along b:
Projection vector = [(a · b)/|b|] [b/|b|]
The adjacent brackets mean that the scalar component multiplies the unit vector. Simplifying gives:
proj_b(a) = [(a · b)/|b|^2] b
This answer is a vector. The second factor of |b| appears because attaching a unit direction requires another division by |b|.
Projection length: always nonnegative
If the question explicitly asks for the length or magnitude of the projection, use:
Projection length = |a · b|/|b|
Terminology can be shortened in exercises. If a question says only “projection,” read its context and expected form carefully. In this guide, scalar projection always means the signed component, and projection length means its absolute value.
For additional explanation of projection and perpendicular components, see OpenStax’s dot-product lesson.
One Pair of Vectors, Three Projection Answers
Take a = (3, 4, 0) and b = (2, 0, 0).
a · b = 6, |b| = 2, and |b|^2 = 4.
The scalar projection of a onto b is:
6/2 = 3
The vector projection is:
(6/4)(2, 0, 0) = (3, 0, 0)
The projection length is:
|6|/2 = 3
The two scalar answers happen to match because the component is positive. That does not make them interchangeable in every question.
Reverse the reference direction
Keep a the same, but use c = (-2, 0, 0).
Now a · c = -6 and |c| = 2.
- Scalar projection of a onto c:
-6/2 = -3. - Vector projection:
(-6/4)(-2, 0, 0) = (3, 0, 0). - Projection length:
|-6|/2 = 3.
Why did the vector stay the same? The line onto which we project did not change. Only its chosen positive direction reversed. The signed component changed sign, and the unit direction changed sign too, so their product stayed unchanged.
This is a useful way to catch the mistaken claim that a negative scalar projection means a negative length.
Reverse which vector is projected
Return to b = (2, 0, 0). Now project b onto a.
Scalar projection = (b · a)/|a| = 6/5
Vector projection = (6/25)(3, 4, 0)
= (18/25, 24/25, 0)
These differ from the earlier answers. The dot product is unchanged when its inputs swap, but the reference direction and denominator have changed.
A Complete Projection and Perpendicular-Component Example
Let a = (5, 1, 2) and b = (1, 2, 2).
We want to split a into one vector parallel to b and one perpendicular to b.
Step 1: Find the shared working.
a · b = 5 + 2 + 4 = 11
|b|^2 = 1 + 4 + 4 = 9
Step 2: Find the parallel component p.
p = (11/9)b = (11/9, 22/9, 22/9)
Step 3: Subtract it from a to find the remaining component q.
q = a - p
q = (34/9, -13/9, -4/9)
Step 4: Check perpendicularity.
q · b = 34/9 - 26/9 - 8/9 = 0
Also, adding p and q gives (5, 1, 2) again. Both checks pass.
Cross Product: Build a Perpendicular Vector
In three dimensions, a × b is a vector perpendicular to both a and b when the cross product is nonzero.
Its magnitude is:
|a × b| = |a||b| sin(theta)
For nonparallel vectors, this is also the area of the parallelogram with adjacent sides a and b. Half of that area gives the corresponding triangle.
The direction follows the right-hand rule: curl the fingers of your right hand from a toward b through the smaller angle; your thumb indicates the direction of a × b.
Reversing the order reverses the result:
b × a = -(a × b)
OpenStax illustrates the direction rule and geometric applications in its cross-product lesson.
The component formula
For a = (a1, a2, a3) and b = (b1, b2, b3):
a × b = (a2b3 - a3b2, a3b1 - a1b3, a1b2 - a2b1)
If you expand the familiar determinant along i, j, k, the signs are +, -, +. The middle component above has already absorbed that minus sign. Do not subtract it a second time.
Example: Find a perpendicular unit vector
Let a = (2, -1, 1) and b = (1, 3, -2).
Calculate each component separately:
- First:
(-1)(-2) - 1(3) = -1. - Second:
1(1) - 2(-2) = 5. - Third:
2(3) - (-1)(1) = 7.
Therefore:
a × b = (-1, 5, 7)
Its magnitude is sqrt(1 + 25 + 49) = sqrt(75) = 5sqrt(3).
A unit vector in the direction of a × b is:
(-1, 5, 7)/(5sqrt(3))
If the question asks for a unit vector perpendicular to both without specifying orientation, either this vector or its negative is valid. If it asks for all such unit vectors, state both.
Now check the cross product against the original vectors:
(-1, 5, 7) · (2, -1, 1) = -2 - 5 + 7 = 0
(-1, 5, 7) · (1, 3, -2) = -1 + 15 - 14 = 0
These checks catch many arithmetic errors. They do not distinguish a cross product from its negative, because both are perpendicular. You still need the correct order or right-hand rule.
Area Questions: Form the Side Vectors First
Suppose a triangle has vertices:
A = (1, 0, 1), B = (3, 1, 1), C = (2, 3, 3).
Do not cross the position vectors of B and C directly. Build two sides from the same vertex:
AB = B - A = (2, 1, 0)
AC = C - A = (1, 3, 2)
Their cross product is:
AB × AC = (2, -4, 5)
Its magnitude is:
sqrt(4 + 16 + 25) = sqrt(45) = 3sqrt(5)
Therefore:
Triangle area = 3sqrt(5)/2 square units.
The parallelogram built on AB and AC would have area 3sqrt(5) square units. The factor of one-half comes from the shape, not from the cross-product formula.
What if the question gives parallelogram diagonals?
The adjacent-side rule cannot be applied unchanged to diagonal vectors.
If adjacent sides are a and b, two possible directed diagonals are d1 = a + b and d2 = a - b. Expanding their cross product gives:
d1 × d2 = -2(a × b)
So:
Parallelogram area = (1/2)|d1 × d2|
For example, diagonals (6, 0, 0) and (0, 4, 0) have cross-product magnitude 24. The parallelogram’s area is 12 square units.
Always identify whether the supplied vectors are sides or diagonals before using an area formula.
Parallel Vectors and the Zero Cross Product
Let a = (2, -3, 1) and b = (-4, 6, -2).
Since b = -2a, they point in opposite directions along parallel lines. Their cross product is the zero vector.
For two nonzero vectors:
a × b = 0 vector means their angle is 0 or 180 degrees.
It does not mean they are perpendicular. The perpendicularity test uses the dot product.
There is another consequence: if a and b are parallel, you cannot divide their cross product by its magnitude to obtain a unit normal. You would be dividing by zero.
Perpendicular vectors still exist, but this pair does not determine one unique normal direction. For instance, (1, 0, 0) and (2, 0, 0) are both perpendicular to every nonzero vector of the form (0, y, z).
Use One Identity to Check Two Calculations
Dot and cross products are connected by:
(a · b)^2 + |a × b|^2 = |a|^2|b|^2
It comes from cos^2(theta) + sin^2(theta) = 1.
For the earlier pair a = (2, -1, 1) and b = (1, 3, -2):
a · b = 2 - 3 - 2 = -3
|a × b|^2 = 75
|a|^2 = 6 and |b|^2 = 14
The check gives:
(-3)^2 + 75 = 84 = 6 × 14
If a question asks only for area and supplies magnitudes and a dot product, this identity can save a full determinant calculation. Use the nonnegative square root for the cross-product magnitude.
It also explains why using sine alone to find an angle can be ambiguous. Angles of 30 and 150 degrees have the same sine, but their dot products have opposite signs.
Common Mistakes and the Repair
| Mistake | Why it fails | Repair |
|---|---|---|
| Leaving a dot product as a vector | The result must be scalar | Add the three component products |
| Using the source magnitude for projection | The denominator sets the reference direction | Use the magnitude of the vector after “onto” |
| Reporting a scalar when a projection vector is requested | Direction is missing | Use the squared denominator and multiply by the reference vector |
| Taking an absolute value too early | It removes direction information | Keep signs until a length or area is required |
| Forgetting the middle determinant sign | It changes the normal vector | Calculate each component separately |
| Reporting the cross product as an area | Area needs a magnitude | Take its length and apply any shape factor |
| Using position vectors as triangle sides | The vectors start at the wrong point | Subtract a common vertex first |
| Normalising a zero cross product | Division by zero is undefined | Check for parallel vectors first |
For applications involving line directions and plane normals, continue with the guide to lines and planes in three dimensions.
Try These Before Reading the Answers
- Find the angle between
(1, 0, 1)and(0, 1, 1). - Find k if
(k, 1, 2)is perpendicular to(2, -4, 1). - Find the scalar projection, vector projection, and projection length of
(-3, 4, 0)onto(1, 0, 0). - Find
(1, 2, 0) × (0, 1, 3). - Find the area of the triangle with vertices
(0, 0, 0),(4, 0, 0), and(0, 3, 0). - Can
(1, 2, 3) × (2, 4, 6)be normalised to produce a unit vector? - If
|a| = 5,|b| = 4, anda · b = 12, find the parallelogram area formed by a and b as adjacent sides. - Resolve
(2, 3, 0)into components parallel and perpendicular to(1, 1, 0).
Answers With the Deciding Step
- The dot product is 1 and both magnitudes are
sqrt(2). Thuscos(theta) = 1/2, so the angle is 60 degrees. 2k - 4 + 2 = 0, giving k = 1.- The dot product is -3 and the reference magnitude is 1. The answers are -3,
(-3, 0, 0), and 3, respectively. - The cross product is
(6, -3, 1). Its dot products with the two input vectors are both zero. - The side cross product is
(0, 0, 12). Half its magnitude gives 6 square units. - No. The vectors are parallel, so their cross product has magnitude zero. A unit normal must be found another way.
- The area is
sqrt(25 × 16 - 12^2) = sqrt(256)= 16 square units. - The dot product is 5 and the reference squared magnitude is 2. The parallel component is
(5/2, 5/2, 0). Subtracting it leaves(-1/2, 1/2, 0), whose dot product with(1, 1, 0)is zero.
Frequently Asked Questions
What is the main difference between dot product and cross product?
A dot product gives a scalar that measures alignment. A cross product in three dimensions gives a vector normal to the two input directions when they are nonparallel; its magnitude measures their parallelogram area.
Which product should I use to find the angle between vectors?
Usually the dot product. Divide it by the product of the two nonzero magnitudes to obtain the cosine of the angle. Its sign distinguishes acute and obtuse angles, whereas a sine value alone may leave two possibilities.
Why does vector projection have a squared denominator?
Scalar projection divides the dot product by the reference magnitude once. Turning that signed number into a vector requires multiplication by the reference unit vector, which introduces a second division by the same magnitude.
Can a projection be negative?
A signed scalar projection can be negative. It means the component points against the reference direction. A projection length cannot be negative. A projection vector is described by its components and direction, rather than being called a negative length.
Is projection of a onto b the same as projection of b onto a?
Generally, no. The reference vector changes, so the denominator and the direction of the projection vector change. The dot product in the numerator is commutative, but the full projection operation is not.
What happens when I project onto the zero vector?
The usual projection formulas are undefined because the reference magnitude is zero and there is no reference direction. Projecting the zero vector onto a nonzero vector, however, gives a zero scalar component and the zero projection vector.
Does a zero dot product always prove a right angle?
It proves a right angle between two nonzero vectors. If either vector is zero, the dot product is still zero, but an ordinary geometric angle is not defined for that pair.
Does a zero cross product mean the vectors are perpendicular?
No. For two nonzero vectors it means they are parallel or oppositely directed. If either vector is zero, their cross product is also zero, so check the inputs before interpreting the result geometrically.
Why does swapping vectors change the cross product but not the area?
Swapping them reverses the cross-product direction. A vector and its negative have the same magnitude, so the corresponding area stays unchanged.
How can I check a perpendicular unit vector quickly?
Check that its magnitude is one and its dot product with each input vector is zero. If the question specifies the direction of a particular cross product, also verify its orientation: those two checks alone cannot distinguish a normal from its negative.
Looking for commerce tuitions?
Prachi is a gold-medalist commerce teacher with experience at Deloitte and KPMG. She focuses on fundamentals to build a strong foundation.