Tutorials › Calculus III › Dot Products in Triangle and Parallelogram Geometry

Dot Products and Projections · Tutorial 68 of 999

Dot Products in Triangle and Parallelogram Geometry

Learn to represent triangle sides and parallelogram diagonals as vectors so dot products reveal their angles and perpendicularity.

Beginner 10 min read

What You'll Learn

  • Build directed side vectors from the coordinates of triangle vertices
  • Select the two outgoing vectors that form an angle at a given vertex
  • Use the dot product to find a triangle angle or test for a right angle
  • Express parallelogram diagonals in terms of two adjacent side vectors
  • Determine when a parallelogram’s diagonals are perpendicular
  • Avoid sign errors caused by choosing a side vector in the wrong direction

From Geometric Sides to Vectors

A triangle or parallelogram is described by points and line segments, but angles and perpendicularity are often easier to analyze using vectors. The key is to turn each relevant side or diagonal into a directed vector, then compare the vectors with a dot product.

Direction matters. An angle at a vertex is formed by two vectors that both start at that vertex. If a side vector points toward the vertex instead, it must be reversed. This choice can change the sign of a dot product and can change an acute angle into an obtuse one.

Definition: If a geometric segment runs from point \(P\) to point \(Q\), its directed vector is \(\overrightarrow{PQ}=Q-P\). If \(P=(p_1,p_2,p_3)\) and \(Q=(q_1,q_2,q_3)\), then \(\overrightarrow{PQ}=(q_1-p_1,q_2-p_2,q_3-p_3)\).

For nonzero vectors \(\mathbf{u}\) and \(\mathbf{v}\), the angle \(\theta\) between them lies in the interval from \(0\) to \(\pi\) and satisfies the dot-product angle formula. In particular, a zero dot product means the vectors are perpendicular.

$$ \cos\theta=\frac{\mathbf{u}\cdot\mathbf{v}}{\|\mathbf{u}\|\|\mathbf{v}\|}, \qquad \mathbf{u}\cdot\mathbf{v}=0 \ \Longleftrightarrow\ \mathbf{u}\perp\mathbf{v}. $$

The angle formula requires both vectors to be nonzero, so their magnitudes in the denominator are positive. For a triangle, the two vectors used to find an interior angle must be the two sides directed outward from that angle’s vertex.

Angles in a Triangle

Let a triangle have vertices \(A\), \(B\), and \(C\). To find the angle at \(A\), use \(\overrightarrow{AB}\) and \(\overrightarrow{AC}\), because both begin at \(A\). The angle at \(B\) uses \(\overrightarrow{BA}\) and \(\overrightarrow{BC}\); the angle at \(C\) uses \(\overrightarrow{CA}\) and \(\overrightarrow{CB}\).

These vectors are constructed directly from the vertex coordinates. Once they are written in components, compute their dot product and magnitudes, then apply the angle formula. If the dot product is zero, the chosen angle is a right angle. If it is positive, the angle is acute; if negative, the angle is obtuse.

Worked Example: Finding a Triangle Angle in Three Dimensions

Let \(A=(0,0,0)\), \(B=(3,0,0)\), and \(C=(1,2,2)\). Find the angle at \(A\).

First form the two vectors that start at \(A\):

$$ \overrightarrow{AB}=B-A=(3,0,0), \qquad \overrightarrow{AC}=C-A=(1,2,2). $$

Their dot product is

$$ \overrightarrow{AB}\cdot\overrightarrow{AC} =(3)(1)+(0)(2)+(0)(2)=3. $$

The magnitudes are

$$ \|\overrightarrow{AB}\|=\sqrt{3^2+0^2+0^2}=3, \qquad \|\overrightarrow{AC}\|=\sqrt{1^2+2^2+2^2}=\sqrt{9}=3. $$

Therefore, the cosine of the angle \(\theta\) at \(A\) is \(3/(3\cdot3)=1/3\), so \(\theta=\cos^{-1}(1/3)\).

Check using the three side lengths. The remaining side vector is \(\overrightarrow{BC}=C-B=(-2,2,2)\), with length \(\sqrt{4+4+4}=2\sqrt{3}\). The law of cosines gives \(\cos\theta=(3^2+3^2-(2\sqrt{3})^2)/(2\cdot3\cdot3)=(9+9-12)/18=1/3\), agreeing with the vector calculation.

Why the Triangle Formula Fits the Side Lengths

The dot product at a vertex can also be related directly to the three side lengths. This gives a useful derivation of why the vector calculation agrees with the law of cosines.

Write \(\mathbf{u}=\overrightarrow{AB}\) and \(\mathbf{v}=\overrightarrow{AC}\). The third side is \(\overrightarrow{BC}=\mathbf{v}-\mathbf{u}\), since it runs from the endpoint of \(\mathbf{u}\) to the endpoint of \(\mathbf{v}\). The squared magnitude identity for a difference gives

$$ \|\mathbf{v}-\mathbf{u}\|^2 =(\mathbf{v}-\mathbf{u})\cdot(\mathbf{v}-\mathbf{u}) =\|\mathbf{u}\|^2+\|\mathbf{v}\|^2-2\mathbf{u}\cdot\mathbf{v}. $$

Rearranging and applying the angle formula at \(A\) yields the following relationship. Here \(a=\|BC\|\), \(b=\|CA\|\), and \(c=\|AB\|\), using the usual convention that each lowercase side is opposite its corresponding uppercase vertex.

$$ \mathbf{u}\cdot\mathbf{v} =\frac{\|\mathbf{u}\|^2+\|\mathbf{v}\|^2-\|\mathbf{v}-\mathbf{u}\|^2}{2} =\frac{b^2+c^2-a^2}{2}, \qquad \cos A=\frac{b^2+c^2-a^2}{2bc}. $$

This derivation relies only on the dot-product definition and the identity for the squared magnitude of a difference. It also shows why a triangle is right-angled at \(A\) exactly when \(a^2=b^2+c^2\): that equality makes \(\overrightarrow{AB}\cdot\overrightarrow{AC}=0\).

Worked Example: Testing a Triangle Angle for Perpendicularity

Let \(A=(0,0,0)\), \(B=(2,0,0)\), and \(C=(2,3,0)\). Determine whether the angle at \(B\) is a right angle.

Both vectors must start at \(B\):

$$ \overrightarrow{BA}=A-B=(-2,0,0), \qquad \overrightarrow{BC}=C-B=(0,3,0). $$

The dot product is

$$ \overrightarrow{BA}\cdot\overrightarrow{BC} =(-2)(0)+(0)(3)+(0)(0)=0. $$

Both vectors are nonzero, so the zero dot product proves that they are perpendicular. Thus the triangle has a right angle at \(B\).

As a check, \(\|\overrightarrow{BA}\|=2\), \(\|\overrightarrow{BC}\|=3\), and \(\overrightarrow{AC}=(2,3,0)\) has length \(\sqrt{13}\). The side-length test gives \(2^2+3^2=13=(\sqrt{13})^2\), which confirms the right angle.

Diagonals of a Parallelogram

Let \(ABCD\) be a parallelogram, with adjacent side vectors \(\mathbf{u}=\overrightarrow{AB}\) and \(\mathbf{v}=\overrightarrow{AD}\). Assume the parallelogram is nondegenerate, so these adjacent sides are not parallel. Starting at \(A\), the opposite vertex is reached by taking both side steps, so \(\overrightarrow{AC}=\mathbf{u}+\mathbf{v}\).

The other diagonal runs from \(B\) to \(D\). Since \(B=A+\mathbf{u}\) and \(D=A+\mathbf{v}\), subtracting the starting point from the endpoint gives \(\overrightarrow{BD}=\mathbf{v}-\mathbf{u}\). These vectors point in the directions of the two diagonals, so their dot product tests whether the diagonals are perpendicular.

Theorem: For adjacent side vectors \(\mathbf{u}\) and \(\mathbf{v}\) of a parallelogram, the directed diagonal vectors \(\mathbf{u}+\mathbf{v}\) and \(\mathbf{v}-\mathbf{u}\) satisfy \((\mathbf{u}+\mathbf{v})\cdot(\mathbf{v}-\mathbf{u})=\|\mathbf{v}\|^2-\|\mathbf{u}\|^2\). The diagonals are perpendicular exactly when the parallelogram’s adjacent sides have equal lengths.

To justify the result, expand the diagonal dot product using distributivity and the symmetry of the dot product:

$$ (\mathbf{u}+\mathbf{v})\cdot(\mathbf{v}-\mathbf{u}) =\mathbf{u}\cdot\mathbf{v}-\mathbf{u}\cdot\mathbf{u} +\mathbf{v}\cdot\mathbf{v}-\mathbf{v}\cdot\mathbf{u} =\|\mathbf{v}\|^2-\|\mathbf{u}\|^2. $$

The mixed terms cancel because \(\mathbf{u}\cdot\mathbf{v}=\mathbf{v}\cdot\mathbf{u}\). The diagonals are perpendicular if and only if this dot product is zero, which holds if and only if \(\|\mathbf{v}\|^2=\|\mathbf{u}\|^2\). Since magnitudes are nonnegative, this is equivalent to \(\|\mathbf{v}\|=\|\mathbf{u}\|\). Thus the perpendicular-diagonal condition is exactly that the parallelogram is a rhombus, including the special case of a square.

Worked Example: Finding the Angle Between Parallelogram Diagonals

Suppose adjacent sides of a parallelogram are \(\mathbf{u}=(2,1,0)\) and \(\mathbf{v}=(1,3,0)\). Find the angle between the diagonals and determine whether they are perpendicular.

The diagonal vectors, directed as \(A\) to \(C\) and \(B\) to \(D\), are

$$ \overrightarrow{AC}=\mathbf{u}+\mathbf{v}=(3,4,0), \qquad \overrightarrow{BD}=\mathbf{v}-\mathbf{u}=(-1,2,0). $$

Their dot product and magnitudes are

$$ \overrightarrow{AC}\cdot\overrightarrow{BD} =(3)(-1)+(4)(2)+(0)(0)=5, $$ $$ \|\overrightarrow{AC}\|=\sqrt{3^2+4^2}=5, \qquad \|\overrightarrow{BD}\|=\sqrt{(-1)^2+2^2}=\sqrt{5}. $$

Consequently, \(\cos\theta=5/(5\sqrt{5})=1/\sqrt{5}\), and the angle between these directed diagonal vectors is \(\theta=\cos^{-1}(1/\sqrt{5})\). The diagonals are not perpendicular because their dot product is \(5\), not zero.

Check with the side lengths: \(\|\mathbf{u}\|^2=2^2+1^2=5\), while \(\|\mathbf{v}\|^2=1^2+3^2=10\). Their difference is \(10-5=5\), exactly the diagonal dot product predicted by the theorem.

Common Direction Mistake

A frequent error is to use a side vector that points toward the angle’s vertex rather than away from it. Reversing one vector changes the sign of the dot product, so the resulting angle can be mistaken for its supplement.

For a concrete example, let \(A=(0,0)\), \(B=(2,0)\), and \(C=(3,1)\). At \(B\), the correct vectors are \(\overrightarrow{BA}=(-2,0)\) and \(\overrightarrow{BC}=(1,1)\). Their dot product is \((-2)(1)+(0)(1)=-2\), so the angle at \(B\) is obtuse. If one incorrectly uses \(\overrightarrow{AB}=(2,0)\) instead, the dot product becomes \((2)(1)+(0)(1)=2\), falsely suggesting an acute angle.

Correction: For an angle at a vertex, subtract that vertex’s coordinates from the coordinates of each neighboring vertex. This makes both side vectors start at the angle being measured.

A Reliable Geometric Procedure

When analyzing a triangle or parallelogram, keep the geometric construction explicit before computing. The following sequence prevents most sign and endpoint errors.

1
Choose the relevant vertex or diagonal.
For a triangle angle, identify its vertex. For a parallelogram, label the two adjacent sides consistently.
2
Write directed vectors from coordinates.
Subtract starting point from ending point, and make both vectors at a triangle angle start at that same vertex.
3
Compute the dot product.
A zero value tests perpendicularity; for an angle, divide by the product of the two nonzero magnitudes.
4
Check the result geometrically.
Use side lengths or the parallelogram diagonal identity to confirm the calculation and its sign.

These methods matter because coordinates can make a geometric relationship testable without relying on a drawing. A sketch may suggest that an angle is acute or that diagonals meet at a right angle, but a dot product supplies an exact criterion. The vector representation also works in three dimensions, where a diagram may not show the true spatial angle.

Check Your Understanding

Use directed vectors and dot products to answer each question.

  1. For a triangle with vertices \(A\), \(B\), and \(C\), which two vectors should be used to find the angle at \(C\)?
  2. If the dot product of the two outward side vectors at a triangle vertex is negative, what can you conclude about the angle?
  3. A parallelogram has adjacent side vectors \(\mathbf{u}\) and \(\mathbf{v}\). Write the diagonal vectors \(\overrightarrow{AC}\) and \(\overrightarrow{BD}\) in terms of \(\mathbf{u}\) and \(\mathbf{v}\).
  4. What condition on the adjacent side lengths makes a parallelogram’s diagonals perpendicular?
  5. Why can using \(\overrightarrow{AB}\) instead of \(\overrightarrow{BA}\) give an incorrect angle at \(B\)?