Non-right Triangles - Law of Cosines
By the end of this section, you will be able to:
- Use the Law of Cosines to solve oblique triangles
- Solve applied problems using the Law of Cosines
- Use Heron’s formula to find the area of a triangle
Suppose a boat leaves port, travels miles, turns degrees, and travels another miles as shown below. How far from port is the boat?
Unfortunately, while the Law of Sines enables us to address many non-right triangle cases, it does not help us with triangles where the known angle is between two known sides, a SAS (side-angle-side) triangle, or when all three sides are known, but no angles are known, a SSS (side-side-side) triangle. In this section, we will investigate another tool for solving oblique triangles described by these last two cases.
Using the Law of Cosines to Solve Oblique Triangles
The tool we need to solve the problem of the boat’s distance from the port is the Law of Cosines, which defines the relationship among angle measurements and side lengths in oblique triangles. Three formulas make up the Law of Cosines. At first glance, the formulas may appear complicated because they include many variables. However, once the pattern is understood, the Law of Cosines is easier to work with than most formulas at this mathematical level.
Understanding how the Law of Cosines is derived will be helpful in using the formulas. The derivation begins with the Generalized Pythagorean Theorem, an extension of the Pythagorean Theorem to non-right triangles. Here is how it works: an arbitrary non-right triangle is placed in the coordinate plane with vertex at the origin, side drawn along the -axis, and vertex located at some point in the plane, as shown below. Generally, triangles exist anywhere in the plane, but for this explanation we will place the triangle as noted.
We can drop a perpendicular from to the -axis (this is the altitude or height). Recalling the basic trigonometric identities, we know that
In terms of , and . The point located at has coordinates . Using the side as one leg of a right triangle and as the second leg, we can find the length of hypotenuse using the Pythagorean Theorem. Thus,
The formula derived is one of the three equations of the Law of Cosines. The other equations are found in a similar fashion.
Keep in mind that it is always helpful to sketch the triangle when solving for angles or sides. In a real-world scenario, try to draw a diagram of the situation. As more information emerges, the diagram may have to be altered. Make those alterations to the diagram and, in the end, the problem will be easier to solve.
Law of Cosines.
The Law of Cosines states that the square of any side of a triangle is equal to the sum of the squares of the other two sides minus twice the product of the other two sides and the cosine of the included angle. For triangles labeled as below, with angles , , and , and opposite corresponding sides , , and , respectively, the Law of Cosines is given as three equations.
To solve for a missing side measurement, the corresponding opposite angle measure is needed.
When solving for an angle, the corresponding opposite side measure is needed. We can use another version of the Law of Cosines to solve for an angle.
How To: given two sides and the angle between them (SAS), find the measures of the remaining side and angles of a triangle.
- Sketch the triangle. Identify the measures of the known sides and angles. Use variables to represent the measures of the unknown sides and angles.
- Apply the Law of Cosines to find the length of the unknown side or angle.
- Apply the Law of Sines or Cosines to find the measure of a second angle.
- Compute the measure of the remaining angle.
Example. Find the unknown side and angles of the triangle below.
Solution. First, make note of what is given: two sides and the angle between them. This arrangement is classified as SAS and supplies the data needed to apply the Law of Cosines.
Each one of the three laws of cosines begins with the square of an unknown side opposite a known angle. For this example, the first side to solve for is side , as we know the measurement of the opposite angle .
Because we are solving for a length, we use only the positive square root. Now that we know the length , we can use the Law of Sines to fill in the remaining angles of the triangle. Solving for angle , we have
The other possibility for would be . In the original diagram, is adjacent to the longest side, so is an acute angle and, therefore, does not make sense. Notice that if we choose to apply the Law of Cosines, we arrive at a unique answer. We do not have to consider the other possibilities, as cosine is unique for angles between and . Proceeding with , we can then find the third angle of the triangle.
The complete set of angles and sides is
Find the missing sideof the triangle with,, and. Round to the nearest tenth.
Sinceis between sidesand, applydirectly.Example. Find the angle for the given triangle if side , side , and side .
Solution. For this example, we have no angles. We can solve for any angle using the Law of Cosines. To solve for angle , we have
See the figure below.
Analysis. Because the inverse cosine can return any angle between and degrees, there will not be any ambiguous cases using this method.
Given,, and, find the missing angles,, and, in that order, each rounded to the nearest tenth of a degree.
,,Each angle has its own direct Law of Cosines formula in terms of,, and— for example,— so solve each independently.Solving Applied Problems Using the Law of Cosines
Just as the Law of Sines provided the appropriate equations to solve a number of applications, the Law of Cosines is applicable to situations in which the given data fits the cosine models. We may see these in the fields of navigation, surveying, astronomy, and geometry, just to name a few.
Example. On many cell phones with GPS, an approximate location can be given before the GPS signal is received. This is accomplished through a process called triangulation, which works by using the distances from two known points. Suppose there are two cell phone towers within range of a cell phone. The two towers are located feet apart along a straight highway, running east to west, and the cell phone is north of the highway. Based on the signal delay, it can be determined that the signal is feet from the first tower and feet from the second tower. Determine the position of the cell phone north and east of the first tower, and determine how far it is from the highway.
Solution. For simplicity, we start by drawing a diagram similar to the figure below and labeling our given information.
Using the Law of Cosines, we can solve for the angle . Remember that the Law of Cosines uses the square of one side to find the cosine of the opposite angle. For this example, let , , and . Thus, corresponds to the opposite side .
To answer the questions about the phone’s position north and east of the tower, and the distance to the highway, drop a perpendicular from the position of the cell phone, as in the figure below. This forms two right triangles, although we only need the right triangle that includes the first tower for this problem.
Using the angle and the basic trigonometric identities, we can find the solutions. Thus
The cell phone is approximately feet east and feet north of the first tower, and feet from the highway.
Example. Returning to our problem at the beginning of this section, suppose a boat leaves port, travels miles, turns degrees, and travels another miles. How far from port is the boat? The diagram is repeated below.
Solution. The boat turned degrees, so the obtuse angle of the non-right triangle is the supplemental angle, . With this, we can utilize the Law of Cosines to find the missing side of the obtuse triangle — the distance of the boat to the port.
The boat is about miles from port.
Using Heron’s Formula to Find the Area of a Triangle
We already learned how to find the area of an oblique triangle when we know two sides and an angle. We also know the formula to find the area of a triangle using the base and the height. When we know the three sides, however, we can use Heron’s formula instead of finding the height. Heron of Alexandria was a geometer who lived during the first century A.D. He discovered a formula for finding the area of oblique triangles when three sides are known.
Heron’s Formula.
Heron’s formula finds the area of oblique triangles in which sides , , and are known.
where is one half of the perimeter of the triangle, sometimes called the semi-perimeter.
Example. Find the area of the triangle below using Heron’s formula.
Solution. First, we calculate .
Then we apply the formula.
The area is approximately square units.
Use Heron’s formula to find the area of a triangle with sides of lengths,, and. Round to the nearest whole square foot.
square feetFind the semi-perimeterfirst, then substitute into.Example. A Chicago city developer wants to construct a building consisting of artist’s lofts on a triangular lot bordered by Rush Street, Wabash Avenue, and Pearson Street. The frontage along Rush Street is approximately meters, along Wabash Avenue it is approximately meters, and along Pearson Street it is approximately meters. How many square meters are available to the developer? See the figure below for a view of the city property.
Solution. Find the measurement for , which is one-half of the perimeter.
Apply Heron’s formula.
The developer has about square meters.
Find the area of a triangle given,, and. Round to the nearest hundredth.
square feetFind the semi-perimeterfirst, then substitute into.Key equations
| Law of Cosines | |
|---|---|
| Heron’s formula |
Key concepts
- The Law of Cosines defines the relationship among angle measurements and lengths of sides in oblique triangles.
- The Generalized Pythagorean Theorem is the Law of Cosines for two cases of oblique triangles: SAS and SSS. Dropping an imaginary perpendicular splits the oblique triangle into two right triangles or forms one right triangle, which allows sides to be related and measurements to be calculated.
- The Law of Cosines is useful for many types of applied problems. The first step in solving such problems is generally to draw a sketch of the problem presented. If the information given fits one of the three models (the three equations), then apply the Law of Cosines to find a solution.
- Heron’s formula allows the calculation of area in oblique triangles. All three sides must be known to apply Heron’s formula.
Key terms
Law of Cosines — states that the square of any side of a triangle is equal to the sum of the squares of the other two sides minus twice the product of the other two sides and the cosine of the included angle. Generalized Pythagorean Theorem — an extension of the Law of Cosines; relates the sides of an oblique triangle and is used for SAS and SSS triangles.
Practice
Use the Law of Cosines to solve oblique triangles
If possible, solve the triangle for the unknown side:,,. Round to the nearest tenth.
is the angle between the two given sidesand, so applydirectly.Use the Law of Cosines to solve for the missing angle of the oblique triangle with,,: find angle. Round to the nearest tenth of a degree.
Use.If possible, solve the triangle for the unknown side:,,. Round to the nearest tenth.
is between sidesand, so the Law of Cosinesgives a quadratic in— solve it and keep the positive root.If possible, solve the triangle for the unknown side:,,.
Withopposite the given side, the Law of Cosinesis a quadratic in; check whether its discriminant is negative.Solve applied problems using the Law of Cosines
A satellite calculates the distances and angle shown: two cities arekm andkm from the satellite, with an angle ofbetween those two sightlines. Find the distance between the two cities. Round to the nearest tenth.
kmThe satellite’sangle is between the two given distances, so apply the Law of Cosines directly.A pilot flies in a straight path forhourminutes. She then makes a course correction, headingto the right of her original course, and flieshours in the new direction. If she maintains a constant speed ofmiles per hour, how far is she from her starting position? Round to the nearest mile.
miConvert each leg’s time to a distance; thecourse correction leaves an interior angle ofat the turn point for the Law of Cosines.Two boats depart at the same time from the same dock. The first boat travels atmiles per hour at a heading of, and the second boat travels atmiles per hour at a heading of. Find the distance between the two boats afterhours. Round to the nearest tenth of a mile.
miConvert each boat’s travel time to a distance, find the angle between the two headings, then apply the Law of Cosines.Use Heron’s formula to find the area of a triangle
Find the area of a triangle with sides of lengthin,in, andin. Round to the nearest hundredth.
Find the semi-perimeterfirst, then substitute into Heron’s formula.Find the area of a triangle with,, and. Round to the nearest hundredth.
Find the semi-perimeterfirst, then substitute into Heron’s formula.Find the area of a triangle with,, and. Round to the nearest hundredth.
Find a common denominator to compute the semi-perimeter, then substitute into Heron’s formula.This section is adapted from Precalculus 2e, Section 8.2: Non-right Triangles: Law of Cosines by Jay Abramson and OpenStax, © OpenStax, licensed under CC BY-NC-SA 4.0. Access the original for free at openstax.org. Changes: recreated all instructional figures as accessible spec-first SVGs built from exact Law-of-Cosines/coordinate computations (never traced) — the opening boat triangle (repeated verbatim at Example 4, matching the source’s own repetition); the coordinate-plane derivation triangle with its dashed altitude and / legs; the standard / labeling triangle; the two worked-example triangles (SAS and SSS); the cell-tower triangle and its right-triangle decomposition; the Heron’s-formula example triangle labeled ; and the Chicago building-lot triangle, whose decorative angled-street-grid background (no primitive in this engine’s figure spec draws city blocks) was simplified to a plain labeled triangle carrying the same three street names and frontages, since that information — not the map art — is what the problem uses. Omitted the decorative boat-hull, cell-tower, and antenna photo overlays, which carry no mathematics, and the “Access these online resources” media links. Every retained Try It became a real fillin component. Where a Try It’s printed solution mixes units the grader cannot compose in one answerForm (a decimal side alongside two degree-valued angles), a single quantity was asked instead of the full solved triangle, following the same adaptation used in Section 8.1: the first Try It (originally , , ) asks only for side , because computing from a rounded grades — one tenth off the source’s own , which only the full-precision chain reproduces — so publishing as a second fillin here would have required pinning a rounded intermediate that does not actually match the printed key. The second Try It’s three angles compose cleanly into one answerForm="degrees" list because each is solved directly from the original , , with its own Law of Cosines formula, with no chained rounding step between them. Every degree-valued answer is keyed with answerForm="degrees" alone (never composed with decimal, which self-rejects a trailing ); every Heron’s-formula area is a decimal fillin. The Practice item drawn from the “solve for the unknown side” exercise set with , , — whose Law of Cosines equation has no real solution for — is authored as a multiplechoice on the triangle count, since “not possible” is a categorical judgment, not a number. Adapted ten selected end-of-section exercises — four Algebraic (three Law of Cosines solves for a side or angle, one no-triangle recognition), three Real-World word problems, and three Heron’s-formula area computations — into a closing Practice block, one group per objective, every answer independently re-derived by running the Law of Cosines and Heron’s-formula arithmetic in Node rather than read off the source key. The area exercise with sides in, in, and in restates its own rounding instruction as “round to the nearest hundredth”: the source’s individual exercise text says “Round to the nearest tenth,” contradicting both the surrounding exercise group’s stated “Round to the nearest hundredth” and the source’s own printed answer key of , which is precise to hundredths — logged as errata.