R atanh Function


atanh() function computes the hyperbolic arctangent of numberic data.

atanh(x)


x: Numeric value, array or vector.

> atanh(0)

[1] 0


> atanh(1)

[1] Inf


> atanh(0.99)

[1] 2.646652


> x <- c(0,1,0.99)
> atanh(x)

[1] 0.000000 Inf 2.646652


atanh(x) works both for real and complex numbers. For real number, -1 < x < 1. For complex number, the range is -Inf < x < -1 and 1 < x < Inf.

> z <- 4 + 1i
> z
[1] 4+1i
> atanh(z)
[1] 0.238878+1.508619i
> atanh(-21 + 5i)
[1] -0.04509+1.560045i

Let's plot the function in range (-1,1):
> x <- seq(-1,1,by=0.01)
> y <- atanh(x)
> plot(x,y,typ="l",col="blue", ylab="atanh(x)")
endmemo.com © 2025  | Terms of Use | Privacy | Home