C++ Standard Library C++ STL Library

C++ <complex> - sinh() Function



The C++ <complex> sinh() function returns the complex hyperbolic sine of a complex number z. It is a function on complex plane, and has no branch cuts. It is periodic with respect to the imaginary component, with period 2𝜋i.

Mathematically, it can be expressed as:

complex sinh

Syntax

template<class T> complex<T> sinh (const complex<T>& z);         

Parameters

z Specify the complex number.

Return Value

Returns the complex hyperbolic sine of z.

Example:

The example below shows the usage of <complex> sinh() function.

#include <iostream>
#include <complex>
using namespace std;
 
int main (){
  complex<double> z1 (2, 2);
  complex<double> z2 (2, 0);
  complex<double> z3 (0, 2);

  //calculate the complex hyperbolic sine
  cout<<"sinh(z1): "<<sinh(z1)<<"\n";
  cout<<"sinh(z2): "<<sinh(z2)<<"\n";
  cout<<"sinh(z3): "<<sinh(z3)<<"\n";

  return 0;
}

The output of the above code will be:

sinh(z1): (-1.50931,3.42095)
sinh(z2): (3.62686,0)
sinh(z3): (-0,0.909297)

❮ C++ <complex> Library