posted 18 years ago
I have this code inside a seperate method :
for (i= 0; i <=terms; i++){
value = (((Math.pow(-1, i)) * (Math.pow(radAngle,(2*i)))) / (factorial(2 * i)));
} return value;
But i can't figure out how to add each term together, the 2nd term has to equal the 1st term plus the 2nd term (kinda like the fibbonacci sequence). And the 3rd term has to equal 2nd plus the 3rd and so on. Can anyone help?
ex) Term1 = 1, term2 = -0.5, term3 = 0.4416 Answer = 1, 0.5, 0.9416