Jump to content
  • Advertisement

Archived

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

glPerfect

Function

This topic is 6086 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
Guest Anonymous Poster
Just about everyone should know that 1 radian = 180/PI degrees

Share this post


Link to post
Share on other sites
i''ve tried the example:

double x=60;
double y=0;
double z=0;


y = cos(x); //y=-0.9524129801516
z = acos(y);

but z = 2.8318530717959

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
  
#include <math.h>


#define DEG2RAD(x) ((x) * M_PI / 180.0)
#define RAD2DEG(x) ((x) * 180.0 / M_PI)

double x = 60; // degrees

double y = 0;
double z = 0;

y = cos(DEG2RAD(x));
z = RAD2DEG(acos(y));

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!