something with sin
quote:Original post by Pipo DeClown
(float)sin(1*180) * Radius = -1
Should it not be 0?
.lick
It takes radians, not degrees....
sinf(Degree*3.1415/180)*Radius
If you''re using floats, use sinf, cosf, tanf, etc rather than sin,cos,tan that way you don''t need the cast to get rid of the warning, sinf, cosf, etc return floats and not doubles .
quote:Original post by Pipo DeClown
Thanks both of you, what are these called again?
What are what called? Radians? Or the sin/cos functions?
--- Edit ---
Here is an easy inlined function to help you out:
__forceinline float fsin(float Degree){ return sinf(Degree*3.1415/180.0f);}//Now you can just call using degreesret = fsin(1*180);
However, I do recommend just using degrees while working with stuff instead of converting back and forth.
[edited by - Ready4Dis on August 7, 2003 7:05:40 AM]
...metry
[edit]D3DXToRadian() works for me
.lick
[edited by - Pipo DeClown on August 7, 2003 7:09:23 AM]
[edit]D3DXToRadian() works for me
.lick
[edited by - Pipo DeClown on August 7, 2003 7:09:23 AM]
Why use the function when all you have to do is multiply the number by 0.017453292519943295769236907684886? (Although you may want more accuracy in that number which is found by pi/180 if you didnt know..)
The last thing I''d ever want to see in the sin(theta) function call would be a conversion factor of that gibberish you just posted. Talk about making things unnecessarily more complicated.
I''m trying to make a loop where the number of times it loops can vary, and the objects I render are in a circle.
That''s my business though.
.lick
That''s my business though.
.lick
const double Pi2 = 6.28318530717958647692528676655901;for(double t = 0; t < Pi2; t += Pi2/10) { double x = sin(t)*radius, y = cos(t)*radius; ... }
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement