{"id":25395,"date":"2021-11-10T09:38:56","date_gmt":"2021-11-10T04:08:56","guid":{"rendered":"https:\/\/python-programs.com\/?p=25395"},"modified":"2021-11-10T09:38:56","modified_gmt":"2021-11-10T04:08:56","slug":"python-cmath-acosh-method-with-examples","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-cmath-acosh-method-with-examples\/","title":{"rendered":"Python cmath.acosh() Method with Examples"},"content":{"rendered":"
cmath.acosh() Method in Python:<\/strong><\/p>\n The cmath.acosh() method returns the complex number’s inverse hyperbolic cosine.<\/p>\n There is one branch cut:<\/p>\n Extending left along the real axis from 1 to -\u221e , continuous from above<\/p>\n Syntax:<\/strong><\/p>\n Parameters<\/strong><\/p>\n x:<\/strong> This is Required. The number used to calculate the inverse hyperbolic cosine of<\/p>\n Return Value:<\/strong><\/p>\n Returns a complex value that represents a number’s inverse hyperbolic arc cosine.<\/p>\n Examples:<\/strong><\/p>\n Example1:<\/strong><\/p>\n Input:<\/strong><\/p>\n Output:<\/strong><\/p>\n Example2:<\/strong><\/p>\n Input:<\/strong><\/p>\n Output:<\/strong><\/p>\n Note:<\/strong> The above input format is for dynamic input.<\/p>\n Approach:<\/strong><\/p>\n Below is the implementation:<\/strong><\/p>\n Output:<\/strong><\/p>\n Approach:<\/strong><\/p>\n Below is the implementation:<\/strong><\/p>\n Output:<\/strong><\/p>\n cmath.acosh() Method in Python: The cmath.acosh() method returns the complex number’s inverse hyperbolic cosine. There is one branch cut: Extending left along the real axis from 1 to -\u221e , continuous from above Syntax: cmath.acosh(x) Parameters x: This is Required. The number used to calculate the inverse hyperbolic cosine of Return Value: Returns a complex …<\/p>\ncmath.acosh(x)<\/pre>\n
Given Complex Number = 3+4j<\/pre>\n
The given complex number's (3+4j) inverse hyperbolic cosine value = \r\n(2.305509031243477+0.9368124611557198j)<\/pre>\n
Given realpart = 5\r\nGiven imaginary part = 2<\/pre>\n
The given complex number's (5+2j) inverse hyperbolic cosine value = \r\n(2.37054853731792+0.38656464251987466j)<\/pre>\n
cmath.acosh() Method with Examples in Python<\/h2>\n
\n
Method #1: Using Built-in Functions (Static Input)<\/h3>\n
\n
# Import cmath module(for complex number operations) using the import keyword.\r\nimport cmath\r\n# Give the complex number as static input and store it in a variable.\r\ngvn_numb = 3+4j\r\n# Pass the given complex number as an argument to the cmath.acosh() method that\r\n# returns the given complex number's inverse hyperbolic cosine value.\r\n# Store it in another variable.\r\nrslt = cmath.acosh(gvn_numb)\r\n# Print the inverse hyperbolic cosine value of the given complex number.\r\nprint(\"The given complex number's\", gvn_numb,\r\n \"inverse hyperbolic cosine value = \")\r\nprint(rslt)\r\n<\/pre>\n
The given complex number's (3+4j) inverse hyperbolic cosine value = \r\n(2.305509031243477+0.9368124611557198j)<\/pre>\n
Method #2: Using Built-in Functions (User Input)<\/h3>\n
\n
# Import cmath module(for complex number operations) using the import keyword.\r\nimport cmath\r\n# Give the real part and imaginary part of the complex number as user input\r\n# using map(), int(), split().\r\n# Store it in two variables.\r\nrealnumb, imaginarynumb = map(int, input(\r\n 'Enter real part and complex part of the complex number = ').split())\r\n# Using a complex() function convert those two variables into a complex number.\r\ncomplexnumb = complex(realnumb, imaginarynumb)\r\n# Pass the given complex number as an argument to the cmath.acosh() method that\r\n# returns the given complex number's inverse hyperbolic cosine value.\r\n# Store it in another variable.\r\nrslt = cmath.acosh(complexnumb)\r\n# Print the inverse hyperbolic cosine value of the given complex number.\r\nprint(\"The given complex number's\", complexnumb,\r\n \"inverse hyperbolic cosine value = \")\r\nprint(rslt)\r\n<\/pre>\n
Enter real part and complex part of the complex number = 5 2\r\nThe given complex number's (5+2j) inverse hyperbolic cosine value = \r\n(2.37054853731792+0.38656464251987466j)<\/pre>\n","protected":false},"excerpt":{"rendered":"