SigmaField
Mathematical Foundations for Quant Finance
0 of 256 lessons
      1. 1.7.1 Angles, the unit circle, sine and cosineConcept · 30 min
      2. 1.7.2 Complex numbersConcept · 25 min
      3. 1.7.3 Euler's formulaConcept · 25 min
      4. 1.7.4 Practice set: trigonometry and complex numbersPractice set · 20 min

Level 1, Precalculus 1.7 Trigonometry and complex numbers Lesson 1 of 4

ConceptLesson 1.7.1 in Level 1, Precalculus. About 30 minutes.

Angles, the unit circle, sine and cosine

Degrees and radians

An angle measures an amount of turning. A full turn is 360 degrees (360°), so a half turn is 180° and a quarter turn, a right angle, is 90°. Turning anticlockwise counts as positive and turning clockwise as negative.

Maths and Python use a second unit, the radian, which comes from a length. Draw the unit circle: radius 1, centred at the origin (0,0)(0, 0). An angle of θ\theta radians at the centre (θ\theta is the Greek letter theta) cuts off an arc of length θ\theta on that circle.

One radian cuts off an arc as long as the radius, about 57.3°. Six radians and a bit go round once: a full turn is 2π≈6.282\pi \approx 6.28 radians, and a half turn is π\pi.

The whole circle has length 2π≈6.2831852\pi \approx 6.283185, so a full turn is 2π2\pi radians. That single fact gives every conversion: 360°=2π360° = 2\pi, so 180°=π180° = \pi and one radian is 180π≈57.2958\frac{180}{\pi} \approx 57.2958 degrees.

On a circle of radius rr, every arc is rr times as long, so the arc length is rθr\theta with θ\theta in radians. A radian is a length divided by a length, so it has no units. An angle written without the ° sign is in radians.

Rule: Converting angles

radians=degrees×π180degrees=radians×180π\begin{gathered} \text{radians} = \text{degrees} \times \frac{\pi}{180} \\ \text{degrees} = \text{radians} \times \frac{180}{\pi} \end{gathered}

Both come from 180°=π180° = \pi radians. The angles below are worth knowing in both units.

degreesradiansas a decimal
30°π6\frac{\pi}{6}0.523599
45°π4\frac{\pi}{4}0.785398
60°π3\frac{\pi}{3}1.047198
90°π2\frac{\pi}{2}1.570796
180°π\pi3.141593
270°3π2\frac{3\pi}{2}4.712389
360°2π2\pi6.283185

Going back, 3π4\frac{3\pi}{4} radians is 34\frac{3}{4} of 180°, which is 135°.

Try it

math.radians and math.degrees do the two conversions. The loop prints the last column of the table.

The last two lines turn 3π4\frac{3\pi}{4} and 1 radian into degrees.

⌘/Ctrl + Enter runs the cell

Sine and cosine on the unit circle

Start at the point (1,0)(1, 0) on the unit circle and turn through an angle θ\theta. The across coordinate of the point you reach is the cosine of θ\theta, written cos⁡θ\cos\theta. The up coordinate is the sine, sin⁡θ\sin\theta.

Rule: Sine and cosine

point at angle θ=(cos⁡θ, sin⁡θ)\text{point at angle } \theta = (\cos\theta,\ \sin\theta)

Cosine is the horizontal coordinate and sine the vertical one. The point stays on a circle of radius 1, so both lie between −1-1 and 1.

The quarter turns land on the axes. At 0 the point is (1,0)(1, 0), so cos⁡0=1\cos 0 = 1 and sin⁡0=0\sin 0 = 0. A quarter turn reaches (0,1)(0, 1), a half turn (−1,0)(-1, 0), and three quarters (0,−1)(0, -1): so sin⁡π2=1\sin\frac{\pi}{2} = 1 and cos⁡π=−1\cos\pi = -1.

Sine and cosine are functions in the sense of lesson 1.1.1: each angle gives one output. Their domain is every real number and their range is [−1,1][-1, 1].

Move the slider and watch the two coordinates. Then try the presets 30°, 150°, 210° and 330°: the sine is 0.5 or −0.5-0.5 each time. Switch on radians to see each angle as a fraction of π\pi.

Explore

Turn the angle. The point on the circle is (cos θ, sin θ): its across distance is the cosine and its height is the sine.

11
Angle
θ = 30°
cos θ (across)
0.866025
sin θ (up)
0.5
Where
quadrant 1; cos² θ + sin² θ = 1

Exact values at 30°, 45° and 60°

Three angles come up so often that their exact values are worth knowing. Each comes from a triangle and Pythagoras' theorem. If a right-angled triangle has shorter sides aa and bb and longest side cc, then a2+b2=c2a^2 + b^2 = c^2.

45°. The radius at 45° is the long side of a right-angled triangle with two equal legs, so cos⁡45°=sin⁡45°\cos 45° = \sin 45°. Call that value aa. Then a2+a2=1a^2 + a^2 = 1, so a2=12a^2 = \frac{1}{2} and a=12=22≈0.707107a = \frac{1}{\sqrt{2}} = \frac{\sqrt{2}}{2} \approx 0.707107.

60°. The point at 60°, the origin and (1,0)(1, 0) make a triangle. Two of its sides are radii, with 60° between them, so all three sides are 1. The point sits above the middle of the base, so cos⁡60°=12\cos 60° = \frac{1}{2}, and Pythagoras gives sin⁡60°=1−14=32≈0.866025\sin 60° = \sqrt{1 - \frac{1}{4}} = \frac{\sqrt{3}}{2} \approx 0.866025.

30°. The point at 30° is the point at 60° mirrored in the line y=xy = x, so the two coordinates swap: cos⁡30°=32\cos 30° = \frac{\sqrt{3}}{2} and sin⁡30°=12\sin 30° = \frac{1}{2}.

The legs of each triangle are the cosine and sine of its angle. At 30° the two legs of the 60° triangle swap places.

angle030° = π6\frac{\pi}{6}45° = π4\frac{\pi}{4}60° = π3\frac{\pi}{3}90° = π2\frac{\pi}{2}
cos⁡θ\cos\theta132\frac{\sqrt{3}}{2}22\frac{\sqrt{2}}{2}12\frac{1}{2}0
sin⁡θ\sin\theta012\frac{1}{2}22\frac{\sqrt{2}}{2}32\frac{\sqrt{3}}{2}1

A pattern helps to remember the sine row: it is 02,12,22,32,42\frac{\sqrt{0}}{2}, \frac{\sqrt{1}}{2}, \frac{\sqrt{2}}{2}, \frac{\sqrt{3}}{2}, \frac{\sqrt{4}}{2}. The cosine row is the same list backwards.

Try it

Each line prints the angle, then cosine and sine from math, then the exact values from the table as decimals. The two pairs agree.

⌘/Ctrl + Enter runs the cell

Signs, and every other angle

The two axes cut the plane into four quadrants, numbered I to IV anticlockwise from the top right. Inside each one the signs of the two coordinates are fixed.

quadrantanglescos⁡θ\cos\thetasin⁡θ\sin\theta
I0° to 90°++++
II90° to 180°−-++
III180° to 270°−-−-
IV270° to 360°++−-

Every point on the circle is a mirror image of one in quadrant I. Its reference angle is the angle between its radius and the horizontal axis, always between 0° and 90°.

Rule: Any angle

size from the reference anglesign from the quadrant\begin{gathered} \text{size from the reference angle} \\ \text{sign from the quadrant} \end{gathered}

The coordinates have the sizes of the reference angle's coordinates. The quadrant decides which of them are negative.

Example 1. Find the exact cosine and sine of 150°, 225° and 300°.

  • 150° is 30° short of 180°, in quadrant II. The reference angle is 30° and the cosine is negative: cos⁡150°=−32\cos 150° = -\frac{\sqrt{3}}{2}, sin⁡150°=12\sin 150° = \frac{1}{2}.
  • 225° is 45° past 180°, in quadrant III. Both are negative: cos⁡225°=sin⁡225°=−22≈−0.707107\cos 225° = \sin 225° = -\frac{\sqrt{2}}{2} \approx -0.707107.
  • 300° is 60° short of 360°, in quadrant IV. Only the sine is negative: cos⁡300°=12\cos 300° = \frac{1}{2}, sin⁡300°=−32\sin 300° = -\frac{\sqrt{3}}{2}.

A negative angle turns clockwise, which mirrors the point in the horizontal axis. The across part stays and the up part flips: cos⁡(−θ)=cos⁡θ\cos(-\theta) = \cos\theta and sin⁡(−θ)=−sin⁡θ\sin(-\theta) = -\sin\theta. So −30°-30° lands where 330° does, at (32,−12)\left(\frac{\sqrt{3}}{2}, -\frac{1}{2}\right).

Try it

The loop prints cosine and sine at an angle in each quadrant, then at −30°-30°. Each pair is an entry of the exact table, with signs.

⌘/Ctrl + Enter runs the cell

The Pythagorean identity

The point (cos⁡θ,sin⁡θ)(\cos\theta, \sin\theta) is always 1 from the origin. Its across and up distances are the legs of a right-angled triangle with long side 1, so Pythagoras' theorem holds at every angle.

Rule: Pythagorean identity

cos⁡2θ+sin⁡2θ=1\cos^2\theta + \sin^2\theta = 1

cos⁡2θ\cos^2\theta means (cos⁡θ)2(\cos\theta)^2. Knowing one of the two and the quadrant gives the other.

Example 2. An angle θ\theta in quadrant IV has cos⁡θ=0.6\cos\theta = 0.6. Find sin⁡θ\sin\theta.

The identity gives sin⁡2θ=1−0.36=0.64\sin^2\theta = 1 - 0.36 = 0.64, so sin⁡θ\sin\theta is 0.8 or −0.8-0.8. In quadrant IV the sine is negative, so sin⁡θ=−0.8\sin\theta = -0.8.

Try it

The loop adds cos⁡2+sin⁡2\cos^2 + \sin^2 at five angles, rounded to 12 places. It is 1 every time, even for 1000°.

Then math.acos(0.6) undoes the cosine, giving the angle between 0 and π\pi with cosine 0.6. Its negative is in quadrant IV, and its sine is −0.8-0.8.

⌘/Ctrl + Enter runs the cell

Periodic functions and their graphs

One more full turn brings the point back to the same place. So sine and cosine repeat every 2π2\pi, that is every 360°. A function that repeats like this is periodic, and the length of the shortest repeat is its period.

Rule: Period of sine and cosine

sin⁡(θ+2π)=sin⁡θcos⁡(θ+2π)=cos⁡θ\begin{gathered} \sin(\theta + 2\pi) = \sin\theta \\ \cos(\theta + 2\pi) = \cos\theta \end{gathered}

Adding or taking away any whole number of turns changes neither. So 30°, 390°, 750° and −330°-330° all have sine 12\frac{1}{2}.

Plotted against θ\theta, both make the same wave between −1-1 and 1. Sine is 0 at every multiple of π\pi, and cosine is 0 halfway between, at π2\frac{\pi}{2}, 3π2\frac{3\pi}{2} and so on. The cosine wave is the sine wave moved π2\frac{\pi}{2} to the left, a shift from lesson 1.1.2: cos⁡θ=sin⁡(θ+π2)\cos\theta = \sin\left(\theta + \frac{\pi}{2}\right).

Tangent

The tangent of θ\theta is the sine divided by the cosine. It is the slope of the radius at angle θ\theta: rise sin⁡θ\sin\theta over run cos⁡θ\cos\theta, as in lesson 1.2.1. From the exact table, tan⁡45°=1\tan 45° = 1, tan⁡60°=3≈1.732051\tan 60° = \sqrt{3} \approx 1.732051 and tan⁡30°=13≈0.57735\tan 30° = \frac{1}{\sqrt{3}} \approx 0.57735.

Tangent breaks where the cosine is 0, at 90°, 270° and every half turn from them. There the radius is vertical and has no slope. Near π2≈1.570796\frac{\pi}{2} \approx 1.570796 it shoots off: it is 14.1014 at 1.5 and 1255.7656 at 1.57, then −34.2325-34.2325 just past, at 1.6.

A half turn flips the signs of both sine and cosine, and leaves their ratio alone. So tangent repeats every π\pi, not every 2π2\pi: tan⁡225°=tan⁡45°=1\tan 225° = \tan 45° = 1.

Rule: Tangent

tan⁡θ=sin⁡θcos⁡θonly where cos⁡θ≠0\begin{gathered} \tan\theta = \frac{\sin\theta}{\cos\theta} \\ \text{only where } \cos\theta \neq 0 \end{gathered}

The slope of the radius at angle θ\theta. Its period is π\pi.

Sine and cosine make the same wave, a quarter turn apart, repeating every 2π2\pi. Tangent repeats every π\pi and shoots off to ±\pm infinity at each dashed line, where cos⁡θ=0\cos\theta = 0.

Try it

The first loop checks the period: four angles a whole number of turns apart, one sine.

The second follows tangent past π2\frac{\pi}{2}: the cosine shrinks to almost 0 and the tangent blows up, then changes sign. Python does not reject math.tan(math.pi / 2). Its π\pi is very slightly off, so the cosine is tiny but not 0, and the answer is huge.

⌘/Ctrl + Enter runs the cell

Lesson 1.7.3 writes the point (cos⁡θ,sin⁡θ)(\cos\theta, \sin\theta) as one complex number, and lesson 2.1.1 needs radians for the limit of sin⁡xx\frac{\sin x}{x} at 0.

Common mistakes

  1. Python works in radians. math.sin(90) is the sine of 90 radians, 0.893997, not of 90°. Convert first with math.radians.
  2. Convert the right way round. Degrees to radians multiplies by π180\frac{\pi}{180}; radians to degrees multiplies by 180π\frac{180}{\pi}.
  3. Cosine is across, sine is up. The point at 30° is (32,12)\left(\frac{\sqrt{3}}{2}, \frac{1}{2}\right), not the other way round.
  4. Take the sign from the quadrant. cos⁡150°\cos 150° is −32-\frac{\sqrt{3}}{2}: the size of cos⁡30°\cos 30°, with a minus sign.
  5. The identity gives two answers. sin⁡2θ=0.64\sin^2\theta = 0.64 allows 0.8 and −0.8-0.8. The quadrant decides which.
  6. sin⁡2θ\sin^2\theta means (sin⁡θ)2(\sin\theta)^2, not sin⁡(θ2)\sin(\theta^2). At π6\frac{\pi}{6} they are 0.25 and 0.270734.
  7. Tangent has gaps. At 90° and 270° the cosine is 0 and tan⁡θ\tan\theta has no value, whatever Python prints.

Angles, sine, cosine and tangent

0 of 12 correct

  1. 1.
  2. 2.
  3. 3.
  4. 4.
  5. 5.
  6. 6.
  7. 7.
  8. 8.
  9. 9.
  10. 10.
  11. 11.
  12. 12.
How to type answers
  • Powers with ^: x^7, 2^(1/3), a^-2.
  • Multiply with * or by writing side by side: 3x^2, 2(x+1).
  • ln(x) is the natural log, log(x, 2) is log base 2, e is Euler's number, sqrt(x) is a square root.
  • sin(x), cos(x) and tan(x) take radians; write pi for π and sin(x)^2 for sin²x.
  • Your first answer to each question is saved: it counts towards your score and brings the question back for review.
  • Exact answers like ln(20)/ln(3) are best. Decimals need about 4 significant figures.

Summary card

  • A full turn is 360° or 2π2\pi radians. Radians == degrees ×π180\times \frac{\pi}{180}; degrees == radians ×180π\times \frac{180}{\pi}. Python works in radians.
  • On a circle of radius rr, an angle of θ\theta radians cuts off an arc of length rθr\theta.
  • The point at angle θ\theta on the unit circle is (cos⁡θ,sin⁡θ)(\cos\theta, \sin\theta): cosine across, sine up.
  • Exact values: sin⁡30°=cos⁡60°=12\sin 30° = \cos 60° = \frac{1}{2}, sin⁡45°=cos⁡45°=22\sin 45° = \cos 45° = \frac{\sqrt{2}}{2}, sin⁡60°=cos⁡30°=32\sin 60° = \cos 30° = \frac{\sqrt{3}}{2}. Other angles take the size from the reference angle and the sign from the quadrant.
  • cos⁡(−θ)=cos⁡θ\cos(-\theta) = \cos\theta, sin⁡(−θ)=−sin⁡θ\sin(-\theta) = -\sin\theta, and cos⁡2θ+sin⁡2θ=1\cos^2\theta + \sin^2\theta = 1 for every angle.
  • Sine and cosine repeat every 2π2\pi. tan⁡θ=sin⁡θcos⁡θ\tan\theta = \frac{\sin\theta}{\cos\theta} repeats every π\pi and has no value where cos⁡θ=0\cos\theta = 0.

Free further reading

Optional. This lesson covers what you need; these add more examples and practice. All are free to read.