- パッケージonion
- 実数・虚数とも同様に扱われる
install.packages("onion")
library(onion)
H1
Hi
Hj
Hk
H1-1
Hi-1i
Hi*Hj
Hj*Hk
Hk*Hi
Hi*Hj*Hk
> H1
[1]
Re 1
i 0
j 0
k 0
> Hi
[1]
Re 0
i 1
j 0
k 0
> Hj
[1]
Re 0
i 0
j 1
k 0
> Hk
[1]
Re 0
i 0
j 0
k 1
> H1-1
[1]
Re 0
i 0
j 0
k 0
> Hi-1i
[1]
Re 0
i 0
j 0
k 0
> Hi*Hj
[1]
Re 0
i 0
j 0
k 1
> Hj*Hk
[1]
Re 0
i 1
j 0
k 0
> Hk*Hi
[1]
Re 0
i 0
j 1
k 0
> Hi*Hj*Hk
[1]
Re -1
i 0
j 0
k 0
p <- H1 + 2*Hi + 3*Hj + 4*Hk
q <- 0.1 * H1 + 1.2*Hi + 2.3*Hj + 3.4*Hk
p+q
p-q
p*q
q*p
p/q
> p+q
[1]
Re 1.1
i 3.2
j 5.3
k 7.4
> p-q
[1]
Re 0.9
i 0.8
j 0.7
k 0.6
> p*q
[1]
Re -22.8
i 2.4
j 0.6
k 4.8
> q*p
[1]
Re -22.8
i 0.4
j 4.6
k 2.8
> p/q
[1]
Re 1.256831e+00
i -1.092896e-01
j 5.551115e-17
k -2.185792e-01