onion | R Documentation |
Construct, coerce to, test for, and print onions
octonion(length.out = NULL, Re = 0, i = 0, j = 0,
k = 0, l = 0, il = 0, jl = 0, kl = 0)
as.octonion(x, single = FALSE)
is.octonion(x)
quaternion(length.out = NULL,Re = 0, i = 0, j = 0, k = 0)
as.quaternion(x, single = FALSE)
is.quaternion(x)
is.onion(x)
as.onion(x,type,single=FALSE)
quaternion_to_octonion(from)
octonion_to_quaternion(from)
## S4 method for signature 'onion'
as.matrix(x)
## S4 method for signature 'onion'
as.numeric(x)
length.out |
In functions |
Re |
The real part of the onionic vector returned |
i , j , k |
In functions |
l , il , jl , kl |
In function |
x , from |
Onion to be tested or printed |
single |
In functions |
type |
In function |
Functions quaternion()
and octonion()
use standard
recycling where possible; rbind()
is used.
Functions as.quaternion()
and as.octonion()
coerce to
quaternions and octonions respectively. If given a complex vector,
the real and imaginary components are interpreted
as Re
and i
respectively.
The output of type()
is accepted as the type
argument of
function as.onion()
; thus as.onion(out,type=type(x))
works as
expected.
Generally return onions
An onion is any algebra (over the reals) created by an iterated Cayley-Dickson process. Examples include quaternions, octonions, and sedenions. There does not appear to be a standard generic term for such objects (I have seen n-ion, anion and others. But “onion” is pronouncable and a bona fide English word).
Creating further onions—such as the sedenions—is intended to be straightforward.
There is a nice example of the onion package in use in the
permutations
package, under cayley.Rd
. This also shows
the quaternion group Q8, but from a different perspective.
Robin K. S. Hankin
x <- octonion(Re=1,il=1:3)
x
kl(x) <- 100
x
as.quaternion(diag(4))
# Cayley table for the quaternion group Q8:
a <- c(H1,-H1,Hi,-Hi,Hj,-Hj,Hk,-Hk)
names(a) <- c("+1","-1","+i","-i","+j","-j","+k","-k")
f <- Vectorize(function(x,y){names(a)[a==a[x]*a[y]]})
X <- noquote(outer(1:8,1:8, f))
rownames(X) <- names(a)
colnames(X) <- names(a)
X
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.