Finding the Inverse Hyperbolic Sine of Complex Number in Golang


In Go language, there are built-in functions to find the inverse hyperbolic sine of a complex number. Inverse hyperbolic sine is a mathematical function that returns the value of the inverse hyperbolic sine of a complex number. In this article, we will discuss how to find the inverse hyperbolic sine of a complex number in Go.

Syntax

The syntax to find the inverse hyperbolic sine of a complex number in Go is as follows −

func Asinh(z complex128) complex128

The Asinh() function takes a complex number as an argument and returns the inverse hyperbolic sine of that number.

Example 1: Finding the Inverse Hyperbolic Sine of a Complex Number

Let's consider the following example to find the inverse hyperbolic sine of a complex number −

package main

import (
   "fmt"
   "math/cmplx"
)

func main() {
   // Creating a complex number
   z := complex(4, 3)

   // Finding the inverse hyperbolic sine of the complex number
   asinh := cmplx.Asinh(z)

   // Displaying the result
   fmt.Println("Inverse Hyperbolic Sine of", z, "is", asinh)
}

Output

Inverse Hyperbolic Sine of (4+3i) is (2.305509031243477+0.6339838656391765i)

Example 2: Finding the Inverse Hyperbolic Sine of a Negative Complex Number

Let's consider the following example to find the inverse hyperbolic sine of a negative complex number −

package main

import (
   "fmt"
   "math/cmplx"
)

func main() {
   // Creating a complex number
   z := complex(-5, -12)

   // Finding the inverse hyperbolic sine of the complex number
   asinh := cmplx.Asinh(z)

   // Displaying the result
   fmt.Println("Inverse Hyperbolic Sine of", z, "is", asinh)
}

Output

Inverse Hyperbolic Sine of (-5-12i) is (-3.257054943061329-1.1749515338392524i)

Example 3: Finding the Inverse Hyperbolic Sine of a Pure Imaginary Number

Let's consider the following example to find the inverse hyperbolic sine of a pure imaginary number −

package main

import (
   "fmt"
   "math/cmplx"
)
   
func main() {
   // Creating a complex number
   z := complex(0, 7)
   
   // Finding the inverse hyperbolic sine of the complex number
   asinh := cmplx.Asinh(z)
   
   // Displaying the result
   fmt.Println("Inverse Hyperbolic Sine of", z, "is", asinh)
}

Output

Inverse Hyperbolic Sine of (0+7i) is (2.6339157938496336+1.5707963267948966i)

Conclusion

In this article, we have discussed how to find the inverse hyperbolic sine of a complex number in Go using the built-in Asinh() function. We have also provided examples to help you understand how to use this function to find the inverse hyperbolic sine of different types of complex numbers.

Updated on: 17-Apr-2023

64 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements