Hướng dẫn dùng define cosh python

To compute the Hyperbolic cosine, use the numpy.cosh[] method in Python Numpy. The method is equivalent to 1/2 * [np.exp[x] + np.exp[-x]] and np.cos[1j*x]. Returns the corresponding hyperbolic cosine values. This is a scalar if x is a scalar. The 1st parameter, x is input array. The 2nd and 3rd parameters are optional.

The 2nd parameter is an ndarray, A location into which the result is stored. If provided, it must have a shape that the inputs broadcast to. If not provided or None, a freshly-allocated array is returned.

The 3rd parameter is the condition is broadcast over the input. At locations where the condition is True, the out array will be set to the ufunc result. Elsewhere, the out array will retain its original value.

Steps

At first, import the required library −

import numpy as np

Get the Trigonometric Hyperbolic cosine. Find cosh −

print["\nResult...",np.cosh[np.pi*1j]]

Finding cosh 90 degrees −

print["\nResult...",np.cosh[np.pi/2.]]

Finding cosh 60 degrees −

print["\nResult...",np.cosh[np.pi/3.]]

Finding cosh 45 degrees −

print["\nResult...",np.cosh[np.pi/4.]]

Finding cosh 30 degrees −

print["\nResult...",np.cosh[np.pi/6.]]

Finding cosh 0 degrees −

print["\nResult...",np.cosh[0]]

Example

import numpy as np

# To compute the Hyperbolic cosine, use the numpy.cosh[] method in Python Numpy
# The method is equivalent to 1/2 * [np.exp[x] + np.exp[-x]] and np.cos[1j*x].

print["Get the Trigonometric Hyperbolic cosine..."]

# find cosh
print["\nResult...",np.cosh[np.pi*1j]]

# finding cosh 90 degrees
print["\nResult...",np.cosh[np.pi/2.]]

# finding cosh 60 degrees
print["\nResult...",np.cosh[np.pi/3.]]

# finding cosh 45 degrees
print["\nResult...",np.cosh[np.pi/4.]]

# finding cosh 30 degrees
print["\nResult...",np.cosh[np.pi/6.]]

# finding cosh 0 degrees
print["\nResult...",np.cosh[0]]

Output

Get the Trigonometric Hyperbolic cosine...

Result... [-1+0j]

Result... 2.5091784786580567

Result... 1.600286857702386

Result... 1.3246090892520057

Result... 1.1402383210764286

Result... 1.0

Updated on 25-Feb-2022 06:29:25

  • Related Questions & Answers
  • Compute the inverse Hyperbolic cosine in Python
  • Compute the Hyperbolic cosine of the array elements in Python
  • Compute the inverse Hyperbolic cosine of array elements in Python
  • How to compute the inverse cosine and inverse hyperbolic cosine in PyTorch?
  • Compute the Hyperbolic tangent in Python
  • Compute the Hyperbolic sine in Python
  • Compute the inverse Hyperbolic sine in Python
  • Compute the inverse Hyperbolic tangent in Python
  • Compute the inverse cosine with scimath in Python
  • Compute the inverse hyperbolic tangent with scimath in Python
  • Compute the Hyperbolic tangent of the array elements in Python
  • Compute the Hyperbolic sine of the array elements in Python
  • Compute the inverse Hyperbolic sine of array elements in Python
  • Compute the inverse Hyperbolic tangent of array elements in Python
  • Get the hyperbolic cosine of a given value in Java

To compute the Hyperbolic cosine, use the numpy.cosh[] method in Python Numpy. The method is equivalent to 1/2 * [np.exp[x] + np.exp[-x]] and np.cos[1j*x]. Returns the corresponding hyperbolic cosine values. This is a scalar if x is a scalar. The 1st parameter, x is input array. The 2nd and 3rd parameters are optional.

The 2nd parameter is an ndarray, A location into which the result is stored. If provided, it must have a shape that the inputs broadcast to. If not provided or None, a freshly-allocated array is returned.

The 3rd parameter is the condition is broadcast over the input. At locations where the condition is True, the out array will be set to the ufunc result. Elsewhere, the out array will retain its original value.

Steps

At first, import the required library −

import numpy as np

Get the Trigonometric Hyperbolic cosine. Find cosh −

print["\nResult...",np.cosh[np.pi*1j]]

Finding cosh 90 degrees −

print["\nResult...",np.cosh[np.pi/2.]]

Finding cosh 60 degrees −

print["\nResult...",np.cosh[np.pi/3.]]

Finding cosh 45 degrees −

print["\nResult...",np.cosh[np.pi/4.]]

Finding cosh 30 degrees −

print["\nResult...",np.cosh[np.pi/6.]]

Finding cosh 0 degrees −

print["\nResult...",np.cosh[0]]

Example

import numpy as np

# To compute the Hyperbolic cosine, use the numpy.cosh[] method in Python Numpy
# The method is equivalent to 1/2 * [np.exp[x] + np.exp[-x]] and np.cos[1j*x].

print["Get the Trigonometric Hyperbolic cosine..."]

# find cosh
print["\nResult...",np.cosh[np.pi*1j]]

# finding cosh 90 degrees
print["\nResult...",np.cosh[np.pi/2.]]

# finding cosh 60 degrees
print["\nResult...",np.cosh[np.pi/3.]]

# finding cosh 45 degrees
print["\nResult...",np.cosh[np.pi/4.]]

# finding cosh 30 degrees
print["\nResult...",np.cosh[np.pi/6.]]

# finding cosh 0 degrees
print["\nResult...",np.cosh[0]]

Output

Get the Trigonometric Hyperbolic cosine...

Result... [-1+0j]

Result... 2.5091784786580567

Result... 1.600286857702386

Result... 1.3246090892520057

Result... 1.1402383210764286

Result... 1.0

Updated on 25-Feb-2022 06:29:25

  • Related Questions & Answers
  • Compute the inverse Hyperbolic cosine in Python
  • Compute the Hyperbolic cosine of the array elements in Python
  • Compute the inverse Hyperbolic cosine of array elements in Python
  • How to compute the inverse cosine and inverse hyperbolic cosine in PyTorch?
  • Compute the Hyperbolic tangent in Python
  • Compute the Hyperbolic sine in Python
  • Compute the inverse Hyperbolic sine in Python
  • Compute the inverse Hyperbolic tangent in Python
  • Compute the inverse cosine with scimath in Python
  • Compute the inverse hyperbolic tangent with scimath in Python
  • Compute the Hyperbolic tangent of the array elements in Python
  • Compute the Hyperbolic sine of the array elements in Python
  • Compute the inverse Hyperbolic sine of array elements in Python
  • Compute the inverse Hyperbolic tangent of array elements in Python
  • Get the hyperbolic cosine of a given value in Java

Chủ Đề