R sinh() Function

The sinh() function in R is used to return the hyperbolic sine of a numeric input in radians.

Syntax

sinh(x)

Parameters

x: It is a numeric value.

Return value

It returns a number’s hyperbolic sine (in radians).

Example 1: Basic usage

Usage of sinh() function

sinh(0)

sinh(1)

Output

[1] 0
[1] 1.175201

Example 2: Providing a complex number

Passing complex number

complex_num <- 5 + 1i

sinh(complex_num)

Output

[1] 40.09217+62.44552i

Example 3: Using vector

Using the sinh() function with a vector

vec <- c(-1, 0.5, 0, 0.5, 1)

sinh(vec)

Output

[1] -1.1752012 0.5210953 0.0000000 0.5210953 1.1752012

Example 4: Passing a pi

Let’s find the pi constant’s sinh() value.

sinh(pi)

sinh(pi / 4)

Output

[1] 11.54874


[1] 0.868671

Example 5: Plotting

dt <- seq(-1, 1, by = 0.05)

plot(dt, sinh(dt), typ = "l", col = "red")

abline(v = 0, lty = 6, col = "blue")

Output

Plot the sinh() function to a graph

See also

R atanh()

R tanh()

R cosh()

R atan()

R tan()

Leave a Comment