Jump to content
  • Advertisement

Archived

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

hello_there

cos problem realy easy

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
radian = degree * pi / 180
degree = radian * 180 / pi

edit: all c function use radian.

[edited by - Wildfire on January 31, 2003 4:40:49 AM]

Share this post


Link to post
Share on other sites
doesn't seem to work i'm using the cosine rule to to find a value then doing acos of that but it doen't work am i doing it right or horribly horribly wrong.

[edited by - hello_there on January 31, 2003 4:47:54 AM]

Share this post


Link to post
Share on other sites

    
float angle1 = 45; //degrees

float sine //sinus;

float radians //radians;

float angle2 //degrees;


sine = sin(angle1 * 3.141/180); //convert to radians, c wants radians, not degrees


radians = asin(sine); //c will return the angle in radians


angle2 = radians * 180 / 3.141; //reconvert to degrees



[edited by - Wildfire on January 31, 2003 4:54:56 AM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!