Coding challenge

Write a program that numerically proves that $\sin^2(x)+\cos^2(x)=1$. You can do this by looping $x$ from 0 to "whatever," and printing the result of computing math.sin(x)^2+math.cos(x)^2. If you don't believe this trig. identity works, modify your code to print out $\sin(x)+\cos(x)$ or $\sin^3(x)+\cos^3(x)=1$. You'll see that only $\sin^2(x)+\cos^2(x)=1$ always equals to $1$.

Type your code here:


Lua reference

See your results here:

Show a friend, family member, or teacher what you've done!

Here is a share link to your code: