What is sinh() in R?
The sinh() function returns the hyperbolic sine of a number in radians.
The illustration below shows the mathematical representation of the sinh() function.
Syntax
sinh(num)
Parameter
This function requires a number that represents an angle in radians as a parameter.
The following formula is used to convert degrees to radians.
radians = degrees * ( pi / 180.0 )
Return value
sinh() returns a number’s hyperbolic sine (in radians), which is sent as a parameter.
-
If the value of
numis positive infinity, then the value returned ispositive infinity. -
If the value of
numis negative infinity, then the value returned isnegative infinity. -
If the value of
numis , then the value returned isNaN not a number NaN.
Code
#Positive number in radiansa <- sinh(2.3);print(paste0("sinh(2.3): ", a))#negative number in radiansb <- sinh(-2.3);print(paste0("sinh(-2.3): ", b))#converting the degrees angle into radians and then applying sinh()#degrees = 90c <- sinh(90 * (pi / (180)));print(paste0("sinh(90 * (pi / (180))): ", c))#positive infinityd <- sinh(Inf);print(paste0("sinh(Inf): ", d))#negative infinitye <- sinh(-Inf);print(paste0("sinh(-Inf): ", e))## NANf <- sinh(NaN);print(paste0("sinh(NaN): ", f))