a <- rquat()
b <- rquat()
a
Re(a)
j(a) <- 0.2
a*b
b*a # quaternions are noncommutative
x <- as.octonion(matrix(rnorm(40),nrow=8))
y <- roct()
z <- roct()
x*(y*z) - (x*y)*z # octonions are nonassociative [use associator()]
Run the code above in your browser using DataLab