sin() function for complex number in C++ with Examples Last Updated : 28 Jun, 2023 Comments Improve Suggest changes Like Article Like Report The sin() function for complex numbers is defined in the <complex> header file. This function is the complex version of the sin() function. This function is used to calculate the complex sine of the complex number z. This function returns the sine of the complex number z. Syntaxsin (z); Parameters z: This method takes a mandatory parameter z which represents the complex number. Return value This function returns the sin() of the complex number z.Example 1 C++ // C++ program to demonstrate // example of sin() function // for Complex numbers #include <complex> #include <iostream> using namespace std; int main() { complex<double> complexnumber(0.0, 1.0); // use of sin() function for complex number cout << "The sin of Complex Numbers: " << complexnumber << " is " << sin(complexnumber) << endl; return 0; } OutputThe sin of Complex Numbers: (0,1) is (0,1.1752) Time Complexity: O(1)Auxiliary Space: O(1) Example 2 C++ // C++ program to demonstrate // example of sin() function // for Complex numbers #include <complex> #include <iostream> using namespace std; int main() { complex<double> complexnumber(1.0, 0.0); // Use of sin() function for complex number cout << "The sin of Complex Number: " << complexnumber << " is " << sin(complexnumber) << endl; return 0; } OutputThe sin of Complex Number: (1,0) is (0.841471,0) Time Complexity: O(1)Auxiliary Space: O(1) Comment More infoAdvertise with us Next Article sin() function for complex number in C++ with Examples bansal_rtk_ Follow Improve Article Tags : C++ Practice Tags : CPP Similar Reads sinh() function for Complex Number in C++ The sinh() function is a built-in function in C++ defined in the complex header file. This function is the complex version of the sinh() function available in the cmath header file. This function is used to calculate the complex hyperbolic sine of a complex number z. Syntax: template<class T> 2 min read exp() function for complex number in C++ The exp() function for complex number is defined in the complex header file. This function is the complex version of the exp() function. This function is used to calculate the base e exponential of a complex number z and returns the base-e exponential of complex number z. Syntax: template<class T 2 min read tanh() function for Complex Number in C++ The tanh() function for complex number is defined in the complex header file. This function is the complex version of the tanh() function of cmath header file. This function is used to calculate the complex hyperbolic tangent of the complex number z. Syntax: template<class T> complex<T> 2 min read tan() function for complex number in C++ 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 2 min read cos() function for complex number in C++ The cos() function for a complex number is defined in the complex header file. This function is the complex version of the cos() function. This function is used to calculate the complex cosine of complex number z. This function returns the cos of the complex number z. Syntax: cos (z); Parameter: z: 2 min read Like