Archived

This topic is now archived and is closed to further replies.

something with sin

This topic is 5275 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

(float)sin(1*180) * Radius = -1 Should it not be 0? .lick

Share on other sites
quote:
Original post by Pipo DeClown

Should it not be 0?

.lick

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 .

Share on other sites
Thanks both of you, what are these called again?

.lick

Share on other sites
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 ---

__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]

Share on other sites
...metry

.lick

[edited by - Pipo DeClown on August 7, 2003 7:09:23 AM]

Share on other sites
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..)

Share on other sites
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.

Share on other sites
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.

.lick

Share on other sites
const double Pi2 = 6.28318530717958647692528676655901;for(double t = 0; t < Pi2; t += Pi2/10) {  double x = sin(t)*radius, y = cos(t)*radius;  ... }

Share on other sites
I gave up on the loop since I''d have to set different RenderStates for each object

.lick