Rで三角関数・双曲線関数 Rで数学の色々をいじってみる

  • Trigonometric functions
help(Trig)
cos(x)
sin(x)
tan(x)
acos(x)
asin(x)
atan(x)
atan2(y, x)
cosh(x)
sinh(x)
tanh(x)
acosh(x)
asinh(x)
atanh(x)

x<-seq(from=-10,to=10,length=1000)
ch<-cosh(x)
sh<-sinh(x)
th<-tanh(x)
ylim<-c(-10,10)
plot(x,ch,ylim=ylim,type="l")
par(new=TRUE)
plot(x,sh,ylim=ylim,type="l",col=2)
par(new=TRUE)
plot(x,th,ylim=ylim,type="l",col=3)
  • \cos(z)^2+\sin(z)^2=1, \cosh(z)^2-\sinh(z)^2=1
> cos(z)^2+sin(z)^2
[1] 1+0i
> cosh(z)^2-sinh(z)^2
[1] 1+0i
  • e^{iz}=\cos(z)+i\sin(z),e^{z}=\cosh(z)+\sinh(z)
> z
[1] 3+2i
> exp(complex(real=0,imaginary=1)*z)
[1] -0.1339809+0.0190985i
> cos(z)+complex(real=0,imaginary=1)*sin(z)
[1] -0.1339809+0.0190985i
> cosh(z*complex(real=0,imaginary=1))+sinh(z*complex(real=0,imaginary=1))
[1] -0.1339809+0.0190985i