
-----------------------------------
Homer_simpson
Mon Jun 23, 2003 6:19 pm

equivalent to cosd
-----------------------------------
what's the equivalent for the turing command "cosd" in c++?

-----------------------------------
Mazer
Mon Jun 23, 2003 6:40 pm


-----------------------------------
i can't seem to find one... not that i've looked that thoroughly, i'm still pretty n00bish at C++. but it seems to me that a good site would be www.cprogramming.com
they have a (rather incomplete) listing of C++ functions. there were a few trig ones but they aren't the same as the sind and cosd of turing.

-----------------------------------
Mazer
Mon Jun 23, 2003 6:44 pm


-----------------------------------
wait... it turns out you can use plain old 'cos' or 'sin'. just one catch: the parameter is in radians. i think the ratio for converting degrees to radians is (Pi*degrees)/180

but then again, i suck at math  :lol:

-----------------------------------
AsianSensation
Mon Jun 23, 2003 6:46 pm


-----------------------------------
I don't think there is one in C, I think you have to make it urself, just convert radians to degrees or something, I think martin made something like this.

-----------------------------------
Mazer
Mon Jun 23, 2003 6:53 pm


-----------------------------------

double deg2rad (double degrees)
    {
    double radians = (3.141592653*degrees)/180;
    return 
    }


like that i guess. then it'd be:


cout 