Open In App

Calculate Hyperbolic cosine of a value in R Programming – cosh() Function

cosh() function in R Language is used to calculate the hyperbolic cosine value of the numeric value passed to it as the argument.
 

Syntax: cosh(x)
Parameter: 
x: Numeric value



Example 1: 
 




# R code to calculate cosine of a value
 
# Assigning values to variables
x1 <- 90
x2 <- 30
 
# Using cosh() Function
cosh(x1)
cosh(x2)

Output: 
 



[1] 6.102016e+38
[1] 5.343237e+12

Example 2: 
 




# R code to calculate cosine of a value
 
# Assigning values to variables
x1 <- pi
x2 <- pi / 3
 
# Using cosh() Function
cosh(x1)
cosh(x2)

Output: 
 

[1] 11.59195
[1] 1.600287

 

Article Tags :