Sinh( ) function for complex number in C++


We are given with the task to find the working of sin() function for complex number. The sin( ) function for complex numbers are present in the complex header file which means for calculating the value of sin() we need to add the complex header file in the code. This function is used to calculate the complex hyperbolic sine of complex number.

Syntax

template<class t> complex<t>
Sinh(const complex<t>& x);

Parameter

parameter z can be any complex number and this parameter is defined in the definition of sin() function which makes this parameter mandatory.

Return type

This function returns the complex value of sin( ) as it contains complex number.

Input − Sinh(0,1)

Output − (0,0.84147)

Input − Sinh(1,9)

Output − (-1.0707,0.6359)

Example

#include<iostream.h>
#include<complex.h>
Using namespace std;
int main( ){
   Complex<double> x(2,7);
   Cout<< “ The sinh of “ << x << “ = “ << sinh(x) << endl;
   return 0;
}

Output

If we run the above code it will generate the following output

The sin of (2,7) = (2.734,2.4717)

Example

#include<iostream.h>
#include<complex.h>
Using namespace std;
int main( ){
   Complex<double> x(5, 3);
   Cout<< “ The sinh of “ << x << “ = “ << sinh(x) << endl;
   return 0;
}

Output

If we run the above code it will generate the following output

The sin of (5, 3) = (-73.4606,10.4725)

Updated on: 14-Aug-2020

69 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements