| | |
<math.h> functions
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
i belive what you are looking to use are the acos(), asin(), and atan() functions.
for instance: tan() returns the ratio of the sides (y/x or opposite/adjacent) when given the angle in radians as the argument .... whereas atan() returns the angle in radians, when given the ratio of the sides ( y/x or opposite/adjacent) as the argument.
('arctan' -- called 'atan' here -- is the inverse function of 'tan'. it is the one that is actually used when you use the 2nd key on your calculator in conjunction with 'tan'. And as mentioned, angles are in radians. to convert to degrees, muliply the radian value by 180/pi)
[edit] the functions are called as "atan"... not "arctan" as i originally typed. sorry[/edit]
.
for instance: tan() returns the ratio of the sides (y/x or opposite/adjacent) when given the angle in radians as the argument .... whereas atan() returns the angle in radians, when given the ratio of the sides ( y/x or opposite/adjacent) as the argument.
('arctan' -- called 'atan' here -- is the inverse function of 'tan'. it is the one that is actually used when you use the 2nd key on your calculator in conjunction with 'tan'. And as mentioned, angles are in radians. to convert to degrees, muliply the radian value by 180/pi)
[edit] the functions are called as "atan"... not "arctan" as i originally typed. sorry[/edit]
.
Last edited by jephthah; Jul 9th, 2009 at 8:40 pm.
sorry, i made a typing mistake .. in C/C++ the functions are actually called as "asin()", "acos()" and "atan()"
follow the links i provided above and you'll see the prototypes.
the header is still the same <math.h> (aka <cmath>)
.
follow the links i provided above and you'll see the prototypes.
the header is still the same <math.h> (aka <cmath>)
.
Last edited by jephthah; Jul 9th, 2009 at 8:45 pm.
![]() |
Similar Threads
- Need help learning the loop/do while loop (C++)
- i have some questions about the math Library (C)
- Did I write this correctly, and is there other way to writ it? (Python)
- printing meter yards feet (C++)
- Finding the Big Oh for these Math.functions (Computer Science)
- Issues using Math class (Java)
- Decimal Problem In C (C)
- missing function header (C++)
Other Threads in the C++ Forum
- Previous Thread: ofstream doesn't work or the first line isn't run
- Next Thread: Dark GDK rotation
| Thread Tools | Search this Thread |
api array arrays based beginner binary c++ c/c++ calculator char char* class classes code compile console conversion count delete deploy desktop directshow dll download dynamic dynamiccharacterarray encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory news number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets






