Trionometry

The word trigonometry comes from the Greek words for triangle and measure, and thus describes techniques for measuring the sides of a triangle.

Describe an algorithm for taking a sum of trigonometric functions $a \sin(\theta) + b \cos(\theta)$ and rewriting this in the form $A \cos(\theta + \phi)$.

Suppose you had the following table of values of $\sin$ on the interval $\left[0, \frac{\pi}{2}\right]$:

    0.0                 0.0
    0.07853981633974483 0.078459095727844945
    0.15707963267948966 0.156434465040230869
    0.23561944901923449 0.233445363855905412
    0.31415926535897932 0.309016994374947424
    0.39269908169872416 0.382683432365089772
    0.47123889803846899 0.453990499739546792
    0.54977871437821382 0.522498564715948865
    0.62831853071795865 0.587785252292473129
    0.70685834705770348 0.649448048330183656
    0.78539816339744831 0.707106781186547525
    0.86393797973719314 0.760405965600030938
    0.94247779607693797 0.809016994374947424
    1.02101761241668280 0.852640164354092220
    1.09955742875642763 0.891006524188367861
    1.17809724509617246 0.923879532511286754
    1.25663706143591730 0.951056516295153574
    1.33517687777566213 0.972369920397676603
    1.41371669411540696 0.987688340595137727
    1.49225651045515179 0.996917333733127976
    1.57079632679489662 1.0

Describe algorithms that allow you to approximate $\sin(x)$, $\cos(x)$, $\tan(x)$, $\sec(x)$, $\csc(x)$ and $\cot(x)$ for all possible values of $x$. Your algorithm should ultimately have you determine the value of $\sin(\xi)$ where $0 \le \xi \le \frac{\pi}{2}$. If that point $\xi$ does not appear on this table, you should use linear interpolation between the two closest points.

Suppose you had the above table of values of $\sin$ and you wanted to calculate $sin^{-1}(x)$ for $-1 \le x \le 1$. Describe an algorithm for finding the best approximation using the above table. Your algorithm should ultimately have you determine the value of $\sin^{-1}(\xi)$ where $0 \le \xi \le 1$. If that point $\xi$ does not appear on this table, you should use linear interpolation between the two closest points.