Page 1 of 1

C++ help with math library

Posted: 2005-11-03 12:13am
by Sarevok
I can not seem to find a C++ function for inverse of sin, cosine and tan in the standard math library. Is there any libraries available on the web which provide such functions ?

Posted: 2005-11-03 12:35am
by InnocentBystander

Posted: 2005-11-03 03:45am
by Pu-239
The values are returned in radians though, so you'll have to multiply by 180/pi .

Posted: 2005-11-03 08:32am
by phongn
Pu-239 wrote:The values are returned in radians though, so you'll have to multiply by 180/pi .
Only if you're working in degrees, though.

Posted: 2005-11-03 10:15am
by Dooey Jo
If you have trouble remembering the names for the inverse trigonometric functions in C/C++, you could try to learn the classic names for those functions, which are arcsine, arccosine and so on. That way, the names "atan" and "asin" actually makes some sense, which should make them easier to remember...

Re: C++ help with math library

Posted: 2005-11-03 10:39am
by Durandal
The Shadow wrote:I can not seem to find a C++ function for inverse of sin, cosine and tan in the standard math library. Is there any libraries available on the web which provide such functions ?
Use cmath.

Posted: 2005-11-04 02:41am
by Sarevok
Dooey Jo wrote:If you have trouble remembering the names for the inverse trigonometric functions in C/C++, you could try to learn the classic names for those functions, which are arcsine, arccosine and so on. That way, the names "atan" and "asin" actually makes some sense, which should make them easier to remember...
Arcsine, arccosine and arctangent are still couple of months away from being taught at school. So I never realised the answer was right below my nose ! I wrote a sample program using atan and it worked exactly as I wanted. Thanks !