C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
C++ Math tan()The function finds the tangent of an angle specified in terms of radian. SyntaxConsider a radian 'x'. Syntax would be: float tan(float x); double tan(double x); long double tan(long double x); double tan(integral x); Note: If the value passed is an integral type, then it is cast to double.Parameterx: The value given in radian. Return valueIt returns the tangent of an angle given in radian. Example 1Let's see the simple example when the value of x is positive. #include Output: Tangent of an angle is : 0.176236 In this example, tan() function calculates the tangent of an angle when the value of degree is equal to 10. Example 2Let's see the simple example when the value of degree is negative. #include Output: Tangent of an angle is :-1.72993 In this example, tan() function calculates the tangent of an angle when the value of degree is negative i.e -60.
Next TopicC++ Math Functions
|