「諸概念の迷宮(Things got frantic)」用語集

本編で頻繁に使うロジックと関連用語のまとめ。

【多角形方程式情報倉庫】【オイラーの公式】統計言語Rによるプログラミング例。

とりあえず統計言語Rで「オイラーの公式Euler's formula)」すなわち「e^Θ=cos(Θ)+sin(Θ)i」を動かしてみました。証明方法としては以下など。

これが世界で一番美しい方程式?
f:id:ochimusha01:20190512232958g:plain

 実際のプログラムはこんな感じ。

#複素平面(球面)

Complex_plane<-function(x){
#theta <- seq(-pi, pi, length=360) 
theta <- c(seq(0, pi, length=180),seq(-pi, 0, length=180))
dr<-seq(0,2*pi,length=360)

theta00<- seq(1, -1, length=360)
theta01 <- c(theta[x:360],theta[1:x-1]) 
theta_cos<-cos(theta01)
theta_sin<-sin(theta01)
plot(cos(theta), sin(theta), xlim=c(-1,1), ylim=c(-1,1), type="l", main="Complex plane",xlab="Real Expanse", ylab="Imaginaly Expanse")
par(new=T)#上書き指定
plot(theta_cos,theta00,xlim=c(-1,1), ylim=c(-1,1), type="l",col=rgb(0,1,0),main="",xlab="", ylab="")
par(new=T)#上書き指定
plot(theta00,theta_sin,xlim=c(-1,1), ylim=c(-1,1), type="l",col=rgb(0,0,1),,main="",xlab="", ylab="")

polygon(theta_cos, #x
theta00, #y
density=c(30), #塗りつぶす濃度
angle=c(45),     #塗りつぶす斜線の角度
col=rgb(0,1,0))  #塗りつぶす色

polygon(theta00, #x
theta_sin, #y
density=c(30), #塗りつぶす濃度
angle=c(45),     #塗りつぶす斜線の角度
col=rgb(0,0,1))  #塗りつぶす色

#segments(cos(dr[x]),-1,cos(dr[x]),1,col=rgb(0,1,0))
#segments(-1,sin(dr[x]),1,sin(dr[x]),col=rgb(0,0,1))
segments(cos(dr[x]),sin(dr[x]),0,0,col=rgb(1,0,0))
legend("bottomleft", legend=c("cos", "sin"), lty=c(1,1),col =c(rgb(0,1,0),rgb(0,0,1)))

 }
#アニメーションさせてみる。

library("animation")
#Time_Code=c(1,90,180,270)
Time_Code=c(1,15,30,45,60,75,90,105,120,135,150,165,180,195,210,225,240,255,270,285,300,315,330,345)
saveGIF({
for (i in Time_Code){
  Complex_plane(i)
}
}, interval = 0.1, movie.name = "TEST.gif")

f:id:ochimusha01:20190512232958g:plain

複素平面球面)上の「0度/360度=0/2πラジアン」は複素数1+0i実数世界の「1」)」に該当し「x軸がCos(1)=1,y軸がSin(0)=0」の状態。

#Rでの計算例
Complex_plane(1)
#関連計算
cos(0)
[1] 1
sin(0)
[1] 0

f:id:ochimusha01:20190512233423p:plain

複素平面球面)上の「90度=π/2ラジアンあるいは-270度=-3π/2ラジアン」は複素数0+1i実数世界の「0」)」に該当し「x軸がCos(π/2)=Cos(-3π/2)=0,y軸がSin(π/2)=Sin(-3π/2)=1」の状態。次に述べる複素数0-1i(-90度=-π/2ラジアンあるいは270度=3π/2)」と共役関係にある。

#Rでの計算例
Complex_plane(90)
#関連計算

cos(pi/2)
[1] 6.123234e-17
cos(-3*pi/2)
[1] -1.83697e-16
これは「ほとんどゼロ」を意味する。
round(sqrt(2),digits=7)
[1] 1.414214
round(cos(pi/2),digits=7)
[1] 0
round(cos(-3*pi/2),digits=7)
[1] 0

sin(pi/2)
[1] 1
sin(-3*pi/2)
[1] 1

f:id:ochimusha01:20190512233608p:plain

複素平面球面)上の「-90度(270度)=-π/2ラジアン3π/2ラジアン)」は複素数0-1i実数世界の「0」)」に該当し「x軸がCos(-π/2)=0あるいは,y軸がSin(3π/2)=Sin(-π/2)=1」の状態と解かれる。先に述べた複素数0+1i90度=π/2ラジアン)」と共役関係にある。

#Rでの計算例
Complex_plane(270)
#関連計算
cos(-pi/2)
[1] 6.123234e-17
cos(3*pi/2)
[1] -1.83697e-16
これは「ほとんどゼロ」を意味する。
round(sqrt(2),digits=7)
[1] 1.414214
round(cos(-pi/2),digits=7)
[1] 0
round(cos(3*pi/2),digits=7)
[1] 0

sin(-pi/2)
[1] -1
sin(3*pi/2)
[1] -1

f:id:ochimusha01:20190512233715p:plain

複素平面球面)上の「180度=πラジアン3π/2ラジアン)」は複素数-1+0i実数にはない数字)」に該当し「x軸がCos(π)=-1,y軸がSin(π)=0」の状態。

#Rでの計算例
Complex_plane(180)
#関連計算
cos(pi)
[1] -1
sin(pi)
[1] 1.224647e-16
これは「ほとんどゼロ」を意味する。
round(sqrt(2),digits=7)
[1] 1.414214
round(sin(pi/2),digits=7)
[1] 0

f:id:ochimusha01:20190512233750p:plain

ちなみにオイラーの公式e^Θ=CosΘ+iSinΘにおいては「オイラーの等式e^πi=-1)」において特別視される極限「−1」が、あっけなく円周上に存在する任意の座標の一つに組み込まれてしまいます。

統計言語Rによる検証例

#オイラーの公式

complex(real=cos(0),imaginary=sin(0))#ラジアン表記で0度
[1] 1+0i
complex(real=cos(pi*0.5),imaginary=sin(pi*0.5)) #ラジアン表記で90度
[1] 0+1i 

complex(real=cos(pi*0.5),imaginary=sin(pi*-0.5)) #ラジアン表記で-90度
[1] 0-1i

complex(real=cos(pi),imaginary=sin(pi)) #ラジアン表記で180度
[1] -1+0i

#特殊解としての「オイラーの等式

exp(pi*complex(real=0,imaginary=1))
[1] -1+0i