VOOZH about

URL: https://www.geeksforgeeks.org/cpp/tan-function-for-complex-number-in-cpp/

⇱ tan() function for complex number in C++ - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

tan() function for complex number in C++

Last Updated : 17 Aug, 2022

The tan() function for complex numbers is defined in the complex header file. This function is the complex version of the tan() function. This function is used to calculate the complex tan of the complex number z. This function returns the tan of complex number z.

Syntax:  

tan(z);

Parameter: 

  • z: This method takes a mandatory parameter z which represents the complex number.

Return value: This function returns the tan() of complex number z.

Below programs illustrate the tan() function in C++:

Program 1:


Output: 
The tan of (0,1) is (0,0.761594)

 

Time Complexity: O(1)
Auxiliary Space: O(1)

PROGRAM 2:- 


Output: 
The tan of (1,0) is (1.55741,0)

 

Time Complexity: O(1)
Auxiliary Space: O(1)

Comment
Article Tags: