I have been trying to program some sine equations.
My hope has been to create a loop of 100 iterations to generate results from 0 to 1 which has been successful
I have started with i set to 0
I have incremented it by Pi/200 stopping when i gets to Pi/2
And sin(i) has produced 0 to 1 as hoped for.
The problem is how do I generate 0 to 1 to 0 again
I have tried stopping i when it gets to pi which works very well until the final loop where I get a tiny value. Can anyone help. Am i trying the impossible?
until the final loop where I get a tiny value
Why is a tiny value incorrect if you are trying to get values from 0 to 1?
If you are coding this on a computer or calculator, please, post your code.
Last edited by Ricky (2006-01-24 12:29:35)
"In the real world, this would be a problem. But in mathematics, we can just define a place where this problem doesn't exist. So we'll go ahead and do that now..."
Probably a rounding error if you increment by a real number. Try basing the loop on integers.
As Ricky said, if you post your code we can take a look