| | |
<math.h> functions
Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
![]() |
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
Views: 891 | Replies: 13
| Thread Tools | Search this Thread |
Tag cloud for C++
6 add api array arrays beginner binary bitmap c++ c/c++ calculator char class classes code compile compiler console conversion convert count data delete desktop directshow dll encryption error file forms fstream function functions game getline givemetehcodez google graph homeworkhelper iamthwee ifstream input int integer java lazy lib linkedlist linux loop looping loops map math matrix memory microsoft newbie news node number output parameter pointer problem program programming project proxy python random read recursion recursive reference return sort string strings struct studio system template templates test text tree unix url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






