Snale,
Plus, using radians simplifies taking derivatives and integrals. If you use degrees you have to deal with the multiplication constants.
cos() , sin() functions not returning corect value
Assuming you use C/C++ try this:
#define PI 3.141592654f
#define DEG2RAD(x) ((x*PI)/180.0f)
#define RAD2DEG(x) ((x*180.0f)/PI)
Also (certainly in MSVC) #include math.h...it seems that there are some other functions also called sin & cos that have a completely differnet numbering scheme...dunno what it is, but it seems to happen if you don't #include math.h
NickB
Sod it, forgot that forum removes things between angle brackets
Edited by - NickB on May 29, 2001 8:03:45 PM
#define PI 3.141592654f
#define DEG2RAD(x) ((x*PI)/180.0f)
#define RAD2DEG(x) ((x*180.0f)/PI)
Also (certainly in MSVC) #include math.h...it seems that there are some other functions also called sin & cos that have a completely differnet numbering scheme...dunno what it is, but it seems to happen if you don't #include math.h
NickB
Sod it, forgot that forum removes things between angle brackets
Edited by - NickB on May 29, 2001 8:03:45 PM
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement