We know how to compute the dot product from coordinates, and now we need to use it to find the angle between two vectors, even when they have too many coordinates to draw.
1
The Dot Product as the Pythagorean Leftover
Before finding an exact number of degrees, we want a way to tell from the coordinates alone whether two vectors meet at a 90∘ right angle, or whether the angle between them is under or over 90∘. Let's start with A=[31] and B=[24].
The Dot Product as the Pythagorean Leftover
When we add A and B tip-to-tail, the third side of the triangle is A+B. To compare ∥A+B∥2 with ∥A∥2+∥B∥2, we expand the squared coordinates using (a+b)2=a2+2ab+b2 instead of adding the numbers first:
∥A+B∥2=∥A∥2+∥B∥2+Pythagorean leftover2(A⋅B)
Text solution
Square the length of the sumKeep the coordinates of A=[31] and B=[24] separate inside ∥A+B∥2 so we can see what gets added beyond ∥A∥2 and ∥B∥2.
∥A+B∥2=(3+2)2+(1+4)2
Expand the squares and group the leftoverMultiply out both brackets and move the middle 2ab terms to the end to put the dot product by itself.
Check the sign of the dot productBecause the leftover 2(A⋅B) is positive, the third side A+B is longer than the hypotenuse of a right triangle, so the angle between A and B is under 90∘.
A⋅B=10>0⟹angle is under 90∘
If we keep the lengths ∥A∥ and ∥B∥ fixed and change the angle between them, the leftover 2(A⋅B) tracks how ∥A+B∥2 compares to ∥A∥2+∥B∥2. It is zero right at 90∘, turns positive below 90∘ as the third side A+B stretches out, and turns negative above 90∘ as A+B shrinks.
With the lengths of the two vectors held fixed, changing the angle between them stretches or shrinks their sum, and the leftover dot-product piece is the exact difference between the squared length of their sum and the two squared lengths added together.
2
Orthogonal Vectors in 2D and 3D
Two vectors are orthogonal when they meet at a 90∘ angle, which happens in any number of dimensions whenever the Pythagorean leftover is zero:
orthogonal (90∘)A⋅B=0
When A⋅B=0, we can use that to build a perpendicular vector right away on a 2D plane, or to test whether two 3D vectors meet at 90∘ without trying to draw them in 3D.
Orthogonal Vectors in 2D and 3D
Text solution
Swap coordinates and flip one sign in 2DTo make the dot product with A=[31] cancel to zero, swap the two entries and flip the sign of either one to get [−13] or [1−3].
(3)(−1)+(1)(3)=−3+3=0
Multiply and add matching coordinates in 3DTo check whether 2−12 and 141 meet at 90∘, compute their dot product to see if it equals zero.
(2)(1)+(−1)(4)+(2)(1)=2−4+2=0
So 2−12 and 141 are orthogonal.
3
Shadows and the Cosine Formula
The sign of A⋅B tells us which side of 90∘ the angle is on, but now we want the exact angle θ between A and B. To get an angle that doesn't change when we make either vector longer, we split B into a shadow along A's line plus a 90∘ height piece, and then divide by the lengths of both vectors.
Shadows and the Cosine Formula
In the shadow right triangle, the adjacent side is B's shadow along A and the hypotenuse is ∥B∥, so cos(θ)=HypotenuseAdjacent gives the fraction of B's length that falls along A:
cos(θ)Length of B’s shadow on A=∥A∥A⋅B,=shadow fraction∥A∥∥B∥A⋅B
Text solution
Find the dot product and both lengthsFor A=[31] and B=[24], compute A⋅B along with the length of each vector from the coordinates.
Divide by both lengths to get the shadow fractionMultiply the two numbers inside a single square root before simplifying so you can see the exact fraction.
cos(θ)=102010=20010=10210=21≈0.707
Match the cosine to the angleAbout 70.7% of B's length falls as a forward shadow along A, which is the cosine of a 45∘ angle.
θ=45∘
Making B longer or shorter along the same line changes A⋅B, but the shadow fraction cos(θ)=∥A∥∥B∥A⋅B stays the same for that angle, and turns negative once B rotates past 90∘ and casts its shadow backward behind A.
Changing the length of B changes the dot product, while the shadow fraction depends only on the angle and never goes past 100% of B’s length in either direction.
4
The Cauchy-Schwarz Inequality
For cos(θ)=∥A∥∥B∥A⋅B to give a possible angle in any number of dimensions, that fraction can never go past −1 or 1. The Cauchy-Schwarz inequality says that the size of the dot product ∣A⋅B∣ is always at most ∥A∥∥B∥.
The Cauchy-Schwarz Inequality
cos(θ)=∥A∥∥B∥A⋅B
−1≤?cos(θ)≤?1
In the shadow right triangle, the squared height cannot be negative, so the shadow can never be longer than the vector B casting it:
Shadow2+≥0Height2=∥B∥2⟹∣Shadow∣≤∥B∥
Even when vectors have too many coordinates to draw a triangle, we can divide A and B by their lengths to get unit vectors U=∥A∥A and V=∥B∥B of length 1. Since any squared length is zero or positive, ∥U+V∥2 and ∥U−V∥2 can never be negative:
The dot product reaches +∥A∥∥B∥ only at θ=0∘ (when B points in the exact same direction as A) and −∥A∥∥B∥ only at θ=180∘ (when B points in the exact opposite direction along A's line), where the perpendicular height drops to zero.
5
Angles and Orthogonality in Higher Dimensions
Now we want to find the exact angles between vectors in 4D space, where we cannot picture the vectors at all, using the exact same coordinate steps. Let's compare A=1111 with B=111−1,C=11−1−1, and D=1−1−1−1 as we flip one sign at a time.
Angles and Orthogonality in Higher Dimensions
A1111B111−1C11−1−1D1−1−1−1
θ from A to B,C,D=?
Text solution
Find the length of each 4D vectorEvery coordinate in A,B,C, and D is 1 or −1, so squaring and adding the four coordinates gives a length of 2 for each vector.
∥A∥=12+12+12+12=4=2
One negative sign (B) gives a forward 50% shadowDivide A⋅B by both lengths to find the positive shadow fraction and an angle under 90∘.
A⋅B=1+1+1−1=2⟹cos(θ)=2×22=21⟹θ=60∘
Two negative signs (C) cancel to zeroWhen the dot product is zero, stop without dividing by the lengths because the vectors are already orthogonal.
A⋅C=1+1−1−1=0⟹θ=90∘
Three negative signs (D) flip the 50% shadow backwardA negative dot product puts the shadow behind A, giving an angle over 90∘.
A⋅D=1−1−1−1=−2⟹cos(θ)=2×2−2=−21⟹θ=120∘
Key concepts
Always start with the dot product A⋅B, and stop there if the question only asks whether vectors are orthogonal or whether the angle is under, at, or over 90∘. Computing the lengths ∥A∥ and ∥B∥ is extra work when the sign of A⋅B already answers the question. For A=1111 and C=11−1−1,A⋅C=0 tells you right away that θ=90∘, while A⋅B>0 means under 90∘ and A⋅D<0 means over 90∘. On a 2D plane, you can build an orthogonal vector to A=[31] in one step by swapping the coordinates and flipping one sign to get [−13] or [1−3].
Bring in the vector lengths only when you need an actual shadow length or an exact angle θ. Dividing A⋅B by ∥A∥ divides out A's length to leave the signed length of B's shadow along A, and dividing by ∥B∥ as well gives the shadow fraction cos(θ):
For A=[31] and B=[24],cos(θ)=102010=21, so θ=45∘. If a problem gives you the lengths ∥A∥,∥B∥, and ∥A+B∥ instead of coordinates, find A⋅B from the Pythagorean expansion ∥A+B∥2=∥A∥2+∥B∥2+2(A⋅B). And because B's shadow can never be more than 100% of B's length, Cauchy-Schwarz guarantees ∣A⋅B∣≤∥A∥∥B∥, reaching +∥A∥∥B∥ only at θ=0∘ and −∥A∥∥B∥ only at θ=180∘.
6
Practice
1
Swap the coordinates and flip one sign to find two vectors orthogonal to A=[4−7], and check both with the dot product.
After you swap the two entries of A, how many signs should you flip so the two products have opposite signs and cancel?
Swap 4 and −7 to get [−74], then flip one sign at a time to get [74] and [−7−4] (watch out for flipping both signs to write [7−4], which makes the products add to 28+28=56 instead of canceling). Checking the dot products gives:
Without computing any vector lengths, tell whether the angle between A=3−21 and each vector is under 90∘, exactly 90∘ (orthogonal), or over 90∘: (a) B=121, (b) C=214, (c) D=−121.
Does A⋅B tell you how ∥A+B∥2 compares to ∥A∥2+∥B∥2?
(a) A⋅B=(3)(1)+(−2)(2)+(1)(1)=3−4+1=0, so exactly 90∘ (orthogonal). (b) A⋅C=(3)(2)+(−2)(1)+(1)(4)=6−2+4=8>0. Don't mistake a positive dot product for an angle above 90∘. A positive leftover means the vectors point roughly the same way, so under 90∘. (c) A⋅D=(3)(−1)+(−2)(2)+(1)(1)=−3−4+1=−6<0, so over 90∘.
3
Find the number k that makes the 4D vectors A=2−341 and B=3k1−1 orthogonal.
Be careful not to drop the negative sign on −3 when multiplying by k (writing 9+3k=0 gives the wrong answer k=−3).
Write out the dot product A⋅B in terms of k. What must that sum equal for a 90∘ angle?
Set the dot product equal to zero:
A⋅B=(2)(3)+(−3)(k)+(4)(1)+(1)(−1)=9−3k=0
Be careful not to drop the negative sign on −3 when multiplying by k (writing 9+3k=0 gives the wrong answer k=−3). Solving 9−3k=0 gives k=3.
4
For A=340 and B=345, find the length of B's shadow along A, the length of B's perpendicular height piece from the shadow triangle, and the exact angle θ between A and B.
Divide by ∥A∥ to get B's shadow length (dividing by ∥B∥=50 instead would give A's shadow on B,25).
When you divide A⋅B by a single length to get B's shadow on A, should you divide by ∥A∥ or ∥B∥?
First find A⋅B=(3)(3)+(4)(4)+(0)(5)=25 and ∥A∥=32+42+02=5. Divide by ∥A∥ to get B's shadow length (dividing by ∥B∥=50 instead would give A's shadow on B,25):
Shadow=∥A∥A⋅B=525=5
Since ∥B∥2=32+42+52=50 and Shadow2+Height2=∥B∥2, we get Height2=50−25=25 (take the square root here rather than leaving the height as 25), so:
Height=50−25=5
Then cos(θ)=505=21, which gives θ=45∘.
5
In 4D space, find the shadow fraction cos(θ) and the exact angle θ between A=1224 and B=−11−1−1.
Take the square roots for ∥A∥ and ∥B∥ before dividing (using the squared lengths 25×4=100 gives −201).
After finding A⋅B, watch what happens to the negative signs when you square the entries of B to find ∥B∥.
Compute the dot product and both lengths:
A⋅B∥A∥∥B∥=−1+2−2−4=−5,=1+4+4+16=5,=1+1+1+1=2
Take the square roots for ∥A∥ and ∥B∥ before dividing (using the squared lengths 25×4=100 gives −201):
cos(θ)=5×2−5=−21
Don't drop the minus sign on −21 and answer 60∘. A 50% shadow falling backward behind A makes the angle over 90∘, giving θ=120∘.
6
Two vectors in 10D space have lengths ∥A∥=3 and ∥B∥=4, and their sum has length ∥A+B∥=13. Find A⋅B and the angle θ between A and B.
Don't forget to divide by the 2 in front of A⋅B (leaving A⋅B=−12 gives cos(θ)=−1 and 180∘).
You aren't given the 10 coordinates, so write out the Pythagorean expansion ∥A+B∥2=∥A∥2+∥B∥2+2(A⋅B).
Put the squared lengths into ∥A+B∥2=∥A∥2+∥B∥2+2(A⋅B):
13=9+16+2(A⋅B)⟹2(A⋅B)=−12
Don't forget to divide by the 2 in front of A⋅B (leaving A⋅B=−12 gives cos(θ)=−1 and 180∘):
A⋅B=−6
Then cos(θ)=3×4−6=−21, so θ=120∘.
7
Two vectors in 50D space have lengths ∥A∥=6 and ∥B∥=5. (a) Can A⋅B equal 35? Explain why or why not. (b) If A⋅B=−30, what is the angle θ between A and B, and how do the two vectors point relative to each other?
What is the largest shadow B can possibly cast along A, and what is the largest value ∣A⋅B∣ can have?
(a) No; by the Cauchy-Schwarz inequality, ∣A⋅B∣≤∥A∥∥B∥=6×5=30 (don't compare 35 to the squared product ∥A∥2∥B∥2=900), because B's shadow cannot be longer than B itself. (b) cos(θ)=30−30=−1. Watch the negative sign on −30 so you don't answer 0∘ (same direction): cos(θ)=−1 means B points in the exact opposite direction along the line of A with zero perpendicular height, at θ=180∘.