Trigonometry


In [73]:
import numpy as np
import matplotlib.pyplot as plt

Sine, cosine and tangent

Sine:

  • $\sin\theta = \frac{opp}{hyp}$
  • with triangle with angles A, B and C, and lines a, b and c opposite their respective angles
  • $\frac{a}{\sin A} = \frac{b}{\sin B} = \frac{c}{\sin C}$

Cosine:

  • $\cos\theta = \frac{adj}{hyp}$
  • with triangle with angles A, B and C, and lines a, b and c opposite their respective angles
  • $a^2 = b^2 + c^2 - 2bc \cos A$
  • $b^2 = a^2 + c^2 - 2ac \cos B$
  • $c^2 = a^2 + b^2 - 2ab \cos C$
  • $\cos A = \frac{b^2 + c^2 - a^2}{2bc}$

Tangent:

  • $\tan\theta = \frac{opp}{adj}$

Area of triangle:

  • $\frac{1}{2}ab\sin C$

Measurements

Radians:

  • 1 radian = angle when the arc opposite the angle = r (the 2 points on the circumference)
  • since $c = 2\pi r$, 1 circumference = 2 pi radians

Arc Length:

  • length, s, of arc on circumference with angle $\theta$ in radians
  • $s = r\theta$

Area of Sector:

  • area, a, of sector with angle $\theta$ in radians
  • $\frac{1}{2} r^2\theta$

Small angle approximation

when $\theta \approx 0$ (in radians)

or $\theta = \lim_{\theta\to0}$

$\sin \theta \approx \theta$

$\cos \theta \approx 1 - \frac{\theta^2}{2} \approx 1$

$\tan \theta \approx \theta$

Trigonometric functions

arcsin, arcos and arctan are the inverse (from length to angle in circle)

Domains and ranges:

sin:

  • $\theta = \mathbb{R}$
  • $-1 \le \sin\theta \le 1$
  • $-\frac{\pi}{2} \le \arcsin x \le \frac{\pi}{2}$

cos:

  • $\theta = \mathbb{R}$
  • $-1 \le \cos\theta \le 1$
  • $0 \le \arccos x \le \pi$

tan:

  • $\theta \not= \frac{\pi}{2}, \frac{3\pi}{2} \dots$
  • $\tan$ range is undefined
  • $-\pi \le \arctan x \le \pi$

Graphing:


In [74]:
fig, ax = plt.subplots(1, 3, figsize=(13,4))

x = np.linspace(0, 2*np.pi, 30*np.pi).astype(np.float32)

ax[0].plot(x, np.sin(x), label='sin')
ax[1].plot(x, np.cos(x), label='cos')
ax[2].plot(x, np.tan(x), label='tan')

ax[0].plot(x, np.arcsin(np.sin(x)), label='arcsin')
ax[1].plot(x, np.arccos(np.cos(x)), label='arccos')
ax[2].plot(x, np.arctan(np.tan(x)), label='arctan')

for axes in ax:
    axes.grid(True)
    axes.legend()

plt.show()


/usr/local/lib/python2.7/dist-packages/ipykernel_launcher.py:3: DeprecationWarning: object of type <type 'float'> cannot be safely interpreted as an integer.
  This is separate from the ipykernel package so we can avoid doing imports until

More trigonometric functions

Secant:

  • $\sec \theta = \frac{1}{\cos \theta}$

Cosecant:

  • $\mathrm{cosec} \theta = \frac{1}{\sin \theta}$

Cotangent:

  • $\cot \theta = \frac{1}{\tan\theta} = \frac{\cos\theta}{\sin\theta}$

Graphing:


In [75]:
fig, ax = plt.subplots(1, 3, figsize=(13,4))

x = np.linspace(0, 2*np.pi, 20*np.pi)

ax[0].plot(x, 1/np.cos(x), label='$sec$')
ax[1].plot(x, 1/np.sin(x), label='cosec')
ax[2].plot(x, np.cos(x)/np.sin(x), label='cot')

for axes in ax:
    axes.grid(True)
    axes.set_ylim([-20,20])
    
    axes.legend()

plt.show()


/usr/local/lib/python2.7/dist-packages/ipykernel_launcher.py:3: DeprecationWarning: object of type <type 'float'> cannot be safely interpreted as an integer.
  This is separate from the ipykernel package so we can avoid doing imports until
/usr/local/lib/python2.7/dist-packages/ipykernel_launcher.py:6: RuntimeWarning: divide by zero encountered in divide
  
/usr/local/lib/python2.7/dist-packages/ipykernel_launcher.py:7: RuntimeWarning: divide by zero encountered in divide
  import sys

Identities

$\tan\theta = \frac{\sin\theta}{\cos\theta}$

$\sin^2\theta + \cos^2\theta = 1$

$\sec^2\theta = 1 + \tan^2\theta$

$\mathrm{cosec} \theta = 1 + \cot^2\theta$

Compound angles

Sin:

  • $\sin(A+B) = \sin A\cos B + \cos A\sin B$
  • $\sin(2A) = 2\sin A\cos A$

Cos:

  • $\cos(A+B) = \cos A\cos B - \sin A\sin B$
  • $\cos(2A) = \cos^2A - 2\sin^2B$

    $= 2\cos^2x - 1$

    $= 1 - 2\sin^2x$

Tan:

  • $\tan(A+B) = \frac{\tan A + \tan B}{1 - \tan A\tan B}$
  • $\tan(2A) = \frac{2\tan A}{1 - \tan^2A}$

$r\cos(\theta+a)$

useful to reformat:

$a\cos \theta + b\sin \theta = r\cos(\theta+a)$

$r\cos(\theta + a) = r \cos a \cos \theta - r \sin a \sin \theta$

so:

$r \cos a \cos \theta = a\cos \theta$

$\therefore$ $r \cos a = a$

$- r \sin a \sin \theta = b\sin \theta$

$\therefore$ $r \sin a = -b$

Then solve as simultaneous equations:

solving a:

$\frac{\sin a}{\cos a} = \frac{-b}{a}$

$a \tan a = -b$

solving r:

$r^2\cos^2a + r^2\sin^2a = a^2+b^2$

$r^2 = a^2+b^2$