How it works: Because cos(180)=1, cos(90)=0, cos(0)=-1, the variable my variable will change from negative to positive, and then from positive to negative, and when it is close to 90 degrees, the amplitude of the change will be Far greater than close to 180 and 0 degrees, it simulates the behavior of a pendulum.
All By Me