Lesson goal: The famous sine and cosine identity

Previous: Plot a sine wave | Home | Next: Test the sin/cos identity graphically

In the last lesson, you saw the computer display values for sin and cos. The results are always some long decimal number between -1 and 1. Strange huh? Here's a neat trigonometric identity you may have seen before. If you square the result of a sin and add it to the square of a cos, you'll always get the same number. Do you know what this number is? Try out this code and see. (Hint: This is an example of the famous identity $\sin(x)^2+\cos(x)^2=1$.

Now you try. Write some code to compute the $\sin^2(some-number)+\cos^2(some-number)$. See what you always get.

Type your code here:

See your results here: