Math Is Fun Forum
  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2006-01-24 11:19:17

Registered: 2006-01-19
Posts: 4

Understanding Sines


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?


#2 2006-01-24 12:29:19

Registered: 2005-12-04
Posts: 3,791

Re: Understanding Sines

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..."


#3 2006-01-24 19:10:48

Registered: 2005-01-21
Posts: 7,684

Re: Understanding Sines

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 smile

"The physicists defer only to mathematicians, and the mathematicians defer only to God ..."  - Leon M. Lederman


Board footer

Powered by FluxBB