Advertisement

cos() , sin() functions not returning corect value

Started by May 29, 2001 09:51 AM
11 comments, last by Zerosignull 23 years, 8 months ago
Snale,

Plus, using radians simplifies taking derivatives and integrals. If you use degrees you have to deal with the multiplication constants.
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
Advertisement
Plus, the variable you use in the Power Series Representation of sin has to be in radians for the series to work. Ask me and I''ll continue .

This topic is closed to new replies.

Advertisement