C++ Standard Library C++ STL Library

C++ <complex> - asinh() Function



The C++ <complex> asinh() function returns the complex inverse hyperbolic sine of a complex number z. It is a function on complex plane, and has two branch cuts:

  • Extends from 1j along the imaginary axis to ∞j, continuous from the right.
  • Extends from -1j along the imaginary axis to -∞j, continuous from the left.

Mathematically, it can be expressed as:

complex asinh

Syntax

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

Parameters

z Specify the complex number.

Return Value

Returns the complex inverse hyperbolic sine of z.

Example:

The example below shows the usage of <complex> asinh() 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 inverse hyperbolic sine
  cout<<"asinh(z1): "<<asinh(z1)<<"\n";
  cout<<"asinh(z2): "<<asinh(z2)<<"\n";
  cout<<"asinh(z3): "<<asinh(z3)<<"\n";

  return 0;
}

The output of the above code will be:

asinh(z1): (1.73432,0.754249)
asinh(z2): (1.44364,0)
asinh(z3): (1.31696,1.5708)

❮ C++ <complex> Library