Sin, Cos, and Tan

Sin, Cos, and Tan


  • Given a right angled triangle: a triangle with an angle and sides labelled
  • We have labelled:
    • The angle as θ.
    • The hypotenuse as h, which is the longest side, and is opposite the right angle.
    • The adjacent side as a, which is next to the angle.
    • The opposite side as o, which is opposite the angle.
  • sin, cos, and tan are functions which convert the angle to a ratio of two of the sides:
    • sin θ = o/h
    • cos θ = a/h
    • tan θ = o/a


  • Given the triangle: a triangle with given values for the angle and sides
  • We can calculate:
    • \sin \theta = \frac{1}{2} = 0.5
    • \cos \theta = \frac{1.732}{2} = 0.866...
    • \tan \theta = \frac{1}{1.732} = 0.577...

Code (Python)

import math

# python works in radians, not degrees
theta = math.radians(30)

print(math.sin(theta)) # prints 0.5
print(math.cos(theta)) # prints 0.866...
print(math.tan((theta))) # prints 0.577...


  • sin, cos, and tan are sometimes called sine, cosine, and tangent.
  • A simple way to remember the equations for sin, cos, and tan is sohcahtoa:
    • soh: sin opposite hypotenuse
    • cah: cos adjacent hypotenuse
    • toa: tan opposite adjacent

tan as a function of sin and cos

  • If we re-arrange the equations for the opposite and adjacent: re-arranged sin equation re-arranged cos equation
  • Then we can rewrite tan in terms of sin and cos: tan as an equation of sin and cos
  • Which simplifies to: simplified tan equation

Graphs of sin, cos, and tan

  • We can plot sin on a graph, where:
    • x is between 0 and 360
    • y = sin(x)
    sin plotted as a graph
    • We see that sin(x) is always between -1 and 1
  • And for cos: cos plotted as a graph
    • We see that cos(x) is just sin(x) shifted left by 90°
  • And finally tan: tan plotted as a graph
    • We see that tan(90) and tan(270) aren't defined, as cos(90) and cos(270) are 0, which causes a divide by 0 error.