{"id":24404,"date":"2021-10-14T09:46:07","date_gmt":"2021-10-14T04:16:07","guid":{"rendered":"https:\/\/python-programs.com\/?p=24404"},"modified":"2021-11-05T21:07:35","modified_gmt":"2021-11-05T15:37:35","slug":"python-program-for-sinh-function","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-for-sinh-function\/","title":{"rendered":"Python Program for sinh() Function"},"content":{"rendered":"
In the previous article, we have discussed Python Program for cosh() Function<\/a> The sinh() function in Python computes the Trigonometric Hyperbolic Sine for the given expression.<\/p>\n Syntax:<\/strong><\/p>\n Parameters:<\/strong><\/p>\n x:<\/strong> This is Required. It is a number for which the hyperbolic sine must be calculated. If the value is not a number, a TypeError is returned.<\/p>\n Return Value:<\/strong><\/p>\n Returns a float value representing a number’s hyperbolic sine.<\/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 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 Know all about Mathematical Functions in Python by going through our Python Mathematical Methods Examples<\/a> well explained step by step.<\/p>\n In the previous article, we have discussed Python Program for cosh() Function sinh() Function in Python: The sinh() function in Python computes the Trigonometric Hyperbolic Sine for the given expression. Syntax: math.sinh(x) Parameters: x: This is Required. It is a number for which the hyperbolic sine must be calculated. If the value is not a …<\/p>\n
\nsinh() Function in Python:<\/strong><\/p>\nmath.sinh(x)<\/pre>\n
\n
Given first number = 0.3\r\nGiven second number = 1<\/pre>\n
The result after applying sinh() function on above given first number 0.3 = 0.3045202934471426\r\nThe result after applying sinh() function on above given second number 1 = 1.1752011936438014<\/pre>\n
Given first number = 3\r\nGiven second number = 5.5<\/pre>\n
The result after applying sinh() function on above given first number 3 = 10.017874927409903\r\nThe result after applying sinh() function on above given second number 5.5 = 122.34392274639096<\/pre>\n
Program for cosh() Function in Python<\/h2>\n
\n
Method #1: Using Built-in Functions (Static Input)<\/h3>\n
\n
# Import math module using the import keyword.\r\nimport math\r\n# Give the list as static input and store it in a variable.\r\ngvn_lst = [-1, -3, 1, 0.8]\r\n# Give the first number as static input and store it in another variable.\r\ngvn_numb1 = 0.3\r\n# Apply math.sinh() function to the given first number to get the hyperbolic\r\n# sine value of a given number.\r\n# Store it in another variable.\r\nfnl_rslt = math.sinh(gvn_numb1)\r\n# Print the above result\r\nprint(\"The result after applying sinh() function on above given first number\",\r\n gvn_numb1, \" = \", fnl_rslt)\r\n# similarly do the same for the other number.\r\ngvn_numb2 = 1\r\nprint(\"The result after applying sinh() function on above given second number\",\r\n gvn_numb2, \" = \", math.sinh(gvn_numb2))\r\n# Apply math.sinh() function to the given list element and print it.\r\nprint(\r\n \"The result after applying sinh() function on given list element gvnlst[1] = \", math.sinh(gvn_lst[1]))\r\n<\/pre>\n
The result after applying sinh() function on above given first number 0.3 = 0.3045202934471426\r\nThe result after applying sinh() function on above given second number 1 = 1.1752011936438014\r\nThe result after applying sinh() function on given list element gvnlst[1] = -10.017874927409903<\/pre>\n
Method #2: Using Built-in Functions (User Input)<\/h3>\n
\n
# Import math module using the import keyword.\r\nimport math\r\n# Give the list as user input using list(),map(),input(),and split() functions.\r\n# Store it in a variable.\r\ngvn_lst = list(map(float, input(\r\n 'Enter some random List Elements separated by spaces = ').split()))\r\n# Give the first number as user input using the float(input()) function\r\n# and store it in a variable.\r\ngvn_numb1 = float(input(\"Enter some random number = \"))\r\n# Apply math.sinh() function to the given first number to get the hyperbolic\r\n# sine value of a given number.\r\n# Store it in another variable.\r\nfnl_rslt = math.sinh(gvn_numb1)\r\n# Print the above result\r\nprint(\"The result after applying sinh() function on above given first number\",\r\n gvn_numb1, \" = \", fnl_rslt)\r\n# similarly do the same for the other number.\r\ngvn_numb2 = float(input(\"Enter some random number = \"))\r\nprint(\"The result after applying sinh() function on above given second number\",\r\n gvn_numb2, \" = \", math.sinh(gvn_numb2))\r\n# Apply math.sinh() function to the given list element and print it.\r\nprint(\r\n \"The result after applying sinh() function on given list element gvnlst[2] = \", math.sinh(gvn_lst[2]))\r\n\r\n<\/pre>\n
Enter some random List Elements separated by spaces = 1 1.5 2.5 3\r\nEnter some random number = 3\r\nThe result after applying sinh() function on above given first number 3.0 = 10.017874927409903\r\nEnter some random number = 5.5\r\nThe result after applying sinh() function on above given second number 5.5 = 122.34392274639096\r\nThe result after applying sinh() function on given list element gvnlst[2] = 6.0502044810397875<\/pre>\n
\n