sin() and cos()
Does the angle I specify in sin and cos function in degrees or in radians ???
(you can find me on IRC : #opengl on undernet)
Radians.
I'm reminded of the day my daughter came in, looked over my shoulder at some Perl 4 code, and said, "What is that, swearing?" - Larry Wall
August 16, 2000 03:40 PM
quote: Original post by SKSlayer
Does the angle I specify in sin and cos function in degrees or in radians ???
check out the tutorial on moving through 3d space, as a conversion factor''s used to move to degrees from radians - handy for 360 degree movement..
I know how to convert, that''s what they teached us at school :o)
(you can find me on IRC : #opengl on undernet)
Because sin and cos are pretty slow functions, you could make your own.
Just declare an array called sin[360] and cos [360] and use sin and cos to fill them initially.
Of course, when smaller increments are needed...you''ll need sin() and cos()
Just declare an array called sin[360] and cos [360] and use sin and cos to fill them initially.
Of course, when smaller increments are needed...you''ll need sin() and cos()
oh, okay,
Are they as slow as sqrt ???
Are they as slow as sqrt ???
(you can find me on IRC : #opengl on undernet)
quote: Original post by SKSlayer
oh, okay,
Are they as slow as sqrt ???
Slower.
I tested it:
50000000 sqrt()''s need about 10 s
50000000 sin()''s need about 20 s.
GA
Visit our homepage: www.rarebyte.de.stGA
Well, that''s never gonna happen
I usually wrap
sin(3*PI) is the same as sin(PI) (2*PI is 360° right ?)
I usually wrap
sin(3*PI) is the same as sin(PI) (2*PI is 360° right ?)
(you can find me on IRC : #opengl on undernet)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement