Archived

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

Function

This topic is 5871 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

Guest Anonymous Poster
Just about everyone should know that 1 radian = 180/PI degrees

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