sine and cosine

BlitzMax Forums/BlitzMax Beginners Area/sine and cosine

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I was going to take general opinion(lazy me) but sence I got mixed response I decided to test it myself. this is the program I tested it width:

Local array#[360]

For x = 0 To 359
		array[x] =Cos(x)
Next

sec = MilliSecs()
For x = 0 To 60000
 	n = array[x Mod 360]/array[x Mod 360]*array[x Mod 360]/array[x Mod 360]+array[x Mod 360]/array[x Mod 360]/array[x Mod 360]/array[x Mod 360]
Next
lapse = MilliSecs() - sec 
Print lapse	


sec = MilliSecs()
For x = 0 To 60000
	n = Cos(x Mod 360)/Cos(x Mod 360)*Cos(x Mod 360)/Cos(x Mod 360)+Cos(x Mod 360)/Cos(x Mod 360)/Cos(x Mod 360)/Cos(x Mod 360)
Next
lapse = MilliSecs()-sec
Print lapse


it trully is insignificant compared to the number of cycles it had to perform. on my Athlon xp 2900+
I got 16 millisec VS 50 millisec difference 60000 operations in half of second. I can live width that.
Thanks everybody.