Hi i just want to ask if i want to write a java program that compute sin x and cos x using Taylor series. I don't know the logic about how to write this program and how to get Taylor series through programming
Taylor
Collapse
X
-
Can you write down the i-th term of a Taylor expansion of a certain function inOriginally posted by mia023Hi i just want to ask if i want to write a java program that compute sin x and cos x using Taylor series. I don't know the logic about how to write this program and how to get Taylor series through programming
terms of 'i'? If so you can you can use 'i' as a loop invariant counter:
[code=java]
double taylor= 0;
for (int i= 0; i < max_term_index; i++)
taylor+= current_term_in _terms_of(i);
[/code]
kind regards,
Jos
Comment