TExcelTAD
Home › Pre-Calculus, Geometry & Trigonometry › The Trigonometric Functions

The Trigonometric Functions

Trigonometry starts with one observation: in a right triangle, the ratios between the sides depend only on the angles, not on the size of the triangle. Those ratios are the six trigonometric functions, and they let you turn an angle into lengths and lengths into an angle.

Ratios in a right triangle

Take a right triangle and pick one of its acute angles, θ\theta. Name the sides relative to θ\theta:

  • the hypotenuse is the longest side, opposite the right angle;
  • the opposite side is across from θ\theta;
  • the adjacent side touches θ\theta and is not the hypotenuse.
text
                 /|
   hypotenuse  /  |
             /    |  opposite
           / θ    |
          ---------
           adjacent

The three main functions are:

sin⁡θ=oppositehypotenusecos⁡θ=adjacenthypotenusetan⁡θ=oppositeadjacent\begin{aligned} \sin\theta &= \frac{\text{opposite}}{\text{hypotenuse}} \\ \cos\theta &= \frac{\text{adjacent}}{\text{hypotenuse}} \\ \tan\theta &= \frac{\text{opposite}}{\text{adjacent}} \end{aligned}

The memory aid SOH-CAH-TOA packs all three into one word. Their reciprocals complete the set of six:

Function Definition Reciprocal of
cosecant, csc⁡θ\csc\theta hypotenuse/opposite\text{hypotenuse} / \text{opposite} sin⁡θ\sin\theta
secant, sec⁡θ\sec\theta hypotenuse/adjacent\text{hypotenuse} / \text{adjacent} cos⁡θ\cos\theta
cotangent, cot⁡θ\cot\theta adjacent/opposite\text{adjacent} / \text{opposite} tan⁡θ\tan\theta

Why do these ratios depend only on θ\theta? Two right triangles with the same acute angle θ\theta have all three angles equal, so they are similar (see Congruence and Similarity). Similar triangles are scaled copies, and scaling multiplies every side by the same factor, which cancels in a ratio.

A first computation

A 5-12-13 triangle (52+122=25+144=169=1325^2 + 12^2 = 25 + 144 = 169 = 13^2) with θ\theta opposite the side 5:

python · try it yourself
import math
from fractions import Fraction

opp, adj, hyp = 5, 12, 13
print("sin θ =", Fraction(opp, hyp), " cos θ =", Fraction(adj, hyp), " tan θ =", Fraction(opp, adj))
print("csc θ =", Fraction(hyp, opp), " sec θ =", Fraction(hyp, adj), " cot θ =", Fraction(adj, opp))

theta = math.atan2(opp, adj)            # recover the angle from the sides
print("θ ≈", round(math.degrees(theta), 4), "degrees")
print("check sin:", round(math.sin(theta), 6), "=", round(5 / 13, 6))

# scaling the triangle changes nothing
print("50-120-130 triangle: sin θ =", Fraction(50, 130))
sin θ = 5/13  cos θ = 12/13  tan θ = 5/12
csc θ = 13/5  sec θ = 13/12  cot θ = 12/5
θ ≈ 22.6199 degrees
check sin: 0.384615 = 0.384615
50-120-130 triangle: sin θ = 5/13

Two relations follow straight from the definitions and hold for every θ\theta:

tan⁡θ=sin⁡θcos⁡θ(divide opp/hyp by adj/hyp)sin⁡θ=cos⁡(90∘−θ)(the other acute angle swaps opposite and adjacent)\begin{aligned} \tan\theta &= \frac{\sin\theta}{\cos\theta} && \text{(divide opp/hyp by adj/hyp)} \\ \sin\theta &= \cos(90^\circ - \theta) && \text{(the other acute angle swaps opposite and adjacent)} \end{aligned}

The second is why the name is cosine: the sine of the complementary angle. The same goes for cotangent and cosecant.

Special angles you should know by heart

Two triangles give exact values. Half of a square (45-45-90) has legs 1, 1 and hypotenuse 2\sqrt{2}. Half of an equilateral triangle with side 2 (30-60-90) has sides 1,3,21, \sqrt{3}, 2.

θ\theta sin⁡θ\sin\theta cos⁡θ\cos\theta tan⁡θ\tan\theta
30∘=π630^\circ = \frac{\pi}{6} 12\frac{1}{2} 32\frac{\sqrt{3}}{2} 13=33\frac{1}{\sqrt{3}} = \frac{\sqrt{3}}{3}
45∘=π445^\circ = \frac{\pi}{4} 22\frac{\sqrt{2}}{2} 22\frac{\sqrt{2}}{2} 11
60∘=π360^\circ = \frac{\pi}{3} 32\frac{\sqrt{3}}{2} 12\frac{1}{2} 3\sqrt{3}

Tip: Read the sine column top to bottom as 12,22,32\frac{\sqrt{1}}{2}, \frac{\sqrt{2}}{2}, \frac{\sqrt{3}}{2}. Cosine is the same column upside down.

SymPy knows these exact values:

python · try it yourself
import sympy as sp

for deg in [30, 45, 60]:
    t = sp.rad(deg)
    print(f"{deg}°: sin = {sp.sin(t)}, cos = {sp.cos(t)}, tan = {sp.tan(t)}, sec = {sp.sec(t)}")
30°: sin = 1/2, cos = sqrt(3)/2, tan = sqrt(3)/3, sec = 2*sqrt(3)/3
45°: sin = sqrt(2)/2, cos = sqrt(2)/2, tan = 1, sec = sqrt(2)
60°: sin = sqrt(3)/2, cos = 1/2, tan = sqrt(3), sec = 2

Solving right triangles

"Solving" a triangle means finding all its unknown sides and angles. With one side and one acute angle, or with two sides, a right triangle is fully determined.

  • From an angle and a side, use the ratio that contains the side you know and the side you want.
  • From two sides, use an inverse function (asin, acos, atan, see Inverse Trigonometric Functions) to get an angle, and Pythagoras for the third side.

Example: a ladder 6 m long leans against a wall at 70° to the ground. How high does it reach, and how far is its foot from the wall?

python · try it yourself
import math

L, angle = 6.0, math.radians(70)
height = L * math.sin(angle)       # opposite = hyp · sin
foot = L * math.cos(angle)         # adjacent = hyp · cos
print(f"height = {height:.3f} m, foot = {foot:.3f} m")
print(f"check Pythagoras: {math.hypot(height, foot):.3f} m")

# A ramp rises 0.5 m over 6 m of horizontal run. What is its angle?
print(f"ramp angle = {math.degrees(math.atan(0.5 / 6)):.2f}°")
height = 5.638 m, foot = 2.052 m
check Pythagoras: 6.000 m
ramp angle = 4.76°

In software

  • Splitting a vector into components. A projectile fired at speed vv and angle θ\theta has velocity (v⋅cos⁡θ,v⋅sin⁡θ)(v \cdot \cos\theta, v \cdot \sin\theta). Every game that moves something "in the direction it faces" does this each frame.
  • Slopes and grades. A road grade of 8% means tan⁡θ=0.08\tan\theta = 0.08. Map software, ramps in games and CSS skew all go through tan⁡\tan.
  • Heights from distances. Line-of-sight, camera field of view (tan⁡(fov/2)=half-width/distance\tan(\text{fov}/2) = \text{half-width} / \text{distance}) and shadow lengths are right-triangle problems.

The game math trig lesson shows the same ideas in game code, and the unit circle extends these functions beyond 90°.

Exercises

Exercise 1: All six ratios

A right triangle has legs 8 and 15. For the angle θ\theta opposite the side 8, give all six trig ratios as fractions.

Answer

Hypotenuse 17. sin⁡=817\sin = \frac{8}{17}, cos⁡=1517\cos = \frac{15}{17}, tan⁡=815\tan = \frac{8}{15}, csc⁡=178\csc = \frac{17}{8}, sec⁡=1715\sec = \frac{17}{15}, cot⁡=158\cot = \frac{15}{8}.

Solution
hyp=82+152=64+225=289=17sin⁡=817cos⁡=1517tan⁡=815csc⁡=178sec⁡=1715cot⁡=158\begin{aligned} \text{hyp} &= \sqrt{8^2 + 15^2} = \sqrt{64 + 225} = \sqrt{289} = 17 \\ \sin &= \tfrac{8}{17} \qquad \cos = \tfrac{15}{17} \qquad \tan = \tfrac{8}{15} \\ \csc &= \tfrac{17}{8} \qquad \sec = \tfrac{17}{15} \qquad \cot = \tfrac{15}{8} \end{aligned}

Exercise 2: Find a side

In a right triangle, the angle θ=35∘\theta = 35^\circ and the hypotenuse is 20. Find the opposite and adjacent sides to 2 decimals.

Answer

opposite≈11.47\text{opposite} \approx 11.47, adjacent≈16.38\text{adjacent} \approx 16.38.

Solution
opposite=20⋅sin⁡35∘≈20×0.573576≈11.47adjacent=20⋅cos⁡35∘≈20×0.819152≈16.38\begin{aligned} \text{opposite} &= 20 \cdot \sin 35^\circ \approx 20 \times 0.573576 \approx 11.47 \\ \text{adjacent} &= 20 \cdot \cos 35^\circ \approx 20 \times 0.819152 \approx 16.38 \end{aligned}
python · try it yourself
import math
t = math.radians(35)
print(round(20 * math.sin(t), 2), round(20 * math.cos(t), 2))
11.47 16.38

Exercise 3: From one ratio to the rest

θ\theta is acute and tan⁡θ=724\tan\theta = \frac{7}{24}. Find sin⁡θ\sin\theta and cos⁡θ\cos\theta exactly.

Answer

sin⁡θ=725\sin\theta = \frac{7}{25}, cos⁡θ=2425\cos\theta = \frac{24}{25}.

Solution

Draw a triangle with opposite 7 and adjacent 24. Then hyp=49+576=625=25\text{hyp} = \sqrt{49 + 576} = \sqrt{625} = 25, so sin⁡θ=725\sin\theta = \frac{7}{25} and cos⁡θ=2425\cos\theta = \frac{24}{25}. Check: (725)2+(2425)2=49+576625=1\left(\frac{7}{25}\right)^2 + \left(\frac{24}{25}\right)^2 = \frac{49 + 576}{625} = 1.

Exercise 4: Tree height

You stand 30 m from the base of a tree and look up at its top at an angle of elevation of 28°. Your eyes are 1.6 m above the ground. How tall is the tree?

Answer

About 17.55 m.

Solution

The height above eye level is the opposite side of a right triangle with adjacent 30 m:

h=30⋅tan⁡28∘≈30×0.531709≈15.951 mtree=15.951+1.6≈17.55 m\begin{aligned} h &= 30 \cdot \tan 28^\circ \approx 30 \times 0.531709 \approx 15.951\ \text{m} \\ \text{tree} &= 15.951 + 1.6 \approx 17.55\ \text{m} \end{aligned}
python · try it yourself
import math
print(round(30 * math.tan(math.radians(28)) + 1.6, 2))
17.55

Exercise 5: Velocity components

Write components(speed, angle_deg) that returns (vx, vy) rounded to 3 decimals, and print it for a ball kicked at 20 m/s and 40°.

Answer

(15.321, 12.856).

Solution
python · try it yourself
import math

def components(speed, angle_deg):
    a = math.radians(angle_deg)
    return round(speed * math.cos(a), 3), round(speed * math.sin(a), 3)

print(components(20, 40))
(15.321, 12.856)

Test yourself

In a right triangle with opposite 3, adjacent 4 and hypotenuse 5, what is cos⁡θ\cos\theta?

  1. 35\frac{3}{5}
  2. 45\frac{4}{5}
  3. 34\frac{3}{4}
  4. 54\frac{5}{4}

Why is sin⁡θ\sin\theta the same for every right triangle with the same angle θ\theta?

  1. Because the hypotenuse is always 1
  2. Because such triangles are similar, so side ratios are equal
  3. Because of the Pythagorean theorem
  4. It is not: it depends on the size

Which value is tan⁡60∘\tan 60^\circ?

  1. 12\frac{1}{2}
  2. 32\frac{\sqrt{3}}{2}
  3. 1
  4. 3\sqrt{3}