Quote:
Originally Posted by greggiles
@Tigairius, do you mind explaining a little.
1. What does "i" mean in the this.i?
2. also, what is sin and pi?
|
this.i is just a random variable name, you could've used this.kljglkjdlgka if you wanted. I am using this.i just to increase the X value of the sine function (explained below).
First, pi is a number- it's a constant that is the ratio of a circle's circumference to its diameter. It is equal to approximately 3.14159 (although it's irrational so it actually goes on "forever").
Pi is used closely in the sine function ( aka: sin(x) ). Sine is a repeating wave across the x axis. So, as X increases, it will yield a number between -1 and 1 (as seen on the graph below).
Its wave-like behavior means that as you increase X, it will fluctuate between positive and negative, allowing for us to use it in that fashion to achieve the desired affect of "rotating forward, then back again".
For more information on sine, pi, cosine, or other trigonometric functions, check wikipedia.
http://en.wikipedia.org/wiki/Sine
http://en.wikipedia.org/wiki/Pi