import math
print(math.cosh(-1)) # 1.5430806348152437
print(math.cosh(-1.5)) # 2.352409615243247
print(math.cosh(-5)) # 74.20994852478785
print(math.cosh(0)) # 1.0
print(math.cosh(1)) # 1.5430806348152437
print(math.cosh(1.5)) # 2.352409615243247
print(math.cosh(5)) # 74.20994852478785
Note that all the inputs are in radian. import math
in_degree = 60
in_redian = math.radians(in_degree)
print(math.cosh(in_redian)) # 1.600286857702386
import matplotlib.pyplot as plt
x=[]
y=[]
i=-10
while (i<=10):
x.append(i)
y.append(math.cosh(i))
i=i+0.1
plt.plot(x,y)
plt.axvline(x=0.00,linewidth=2, color='#f1f1f1')
plt.grid(linestyle='-',
linewidth=0.5,color='#f1f1f1')
plt.show()
import math
print(math.cosh(-2)) # Output: 3.7621956910836314 (cosh is symmetric)
import math
angle = math.radians(60)
print(f"cos(60°) = {math.cos(angle)}") # cos(60°)
print(f"cosh(60°) = {math.cosh(angle)}") # cosh(60°)
import math
def cosh_series(x, n_terms=10):
result = 0
for n in range(n_terms):
result += x**(2*n) / math.factorial(2*n)
return result
print(cosh_series(1)) # Approximation of cosh(1)
Author
🎥 Join me live on YouTubePassionate about coding and teaching, I publish practical tutorials on PHP, Python, JavaScript, SQL, and web development. My goal is to make learning simple, engaging, and project‑oriented with real examples and source code.