onion                 package:onion                 R Documentation

_B_a_s_i_c _o_n_i_o_n _f_u_n_c_t_i_o_n_s

_D_e_s_c_r_i_p_t_i_o_n:

     Construct, coerce to, test for, and print onions

_U_s_a_g_e:

     octonion(length.out = NULL, names = NULL, Re = 0, i = 0, j = 0, 
         k = 0, l = 0, il = 0, jl = 0, kl = 0)
     as.octonion(x, single = FALSE, names=NULL)
     is.octonion(x)
     quaternion(length.out = NULL, names = NULL, Re = 0, i = 0, j = 0, k = 0)
     as.quaternion(x, single = FALSE, names=NULL)
     is.quaternion(x)
     is.onion(x)
     as.onion(x,type,names=NULL,single=FALSE)
     type(x)

_A_r_g_u_m_e_n_t_s:

length.out: In functions 'quaternion()' and 'octonion()', the length of
          the onionic vector returned.

   names: In functions 'quaternion()' and 'octonion()', the names of
          the octonionic vector returned.

      Re: The real part of the onionic vector returned.

       i: Component i of the onionic vector returned.

       j: Component j of the onionic vector returned.

       k: In function 'octonion()', component k of the octonionic
          vector returned.

       l: In function 'octonion()', component l of the octonionic
          vector returned.

      il: In function 'octonion()', component il of the octonionic
          vector returned.

      jl: In function 'octonion()', component jl of the octonionic
          vector returned.

      kl: In function 'octonion()', component kl of the octonionic
          vector returned.

       x: Onion to be tested or printed

  single: In functions 'as.octonion()' and 'as.quaternion()', a Boolean
          variable with default 'FALSE' meaning to interpret 'x' as a
          vector of reals to be coerced into an onionic vector with
          zero imaginary part; and 'TRUE' meaning to interpret 'x' as a
          length 4 (or length 8) vector and return the corresponding
          single onion.

    type: In function 'as.onion()' a string either "'quaternion'" or
          "'octonion'" denoting the algebra to be forced into

_D_e_t_a_i_l_s:

     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.

_N_o_t_e:

     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
     terminology for such objects (I have seen n-ion, anion and others.
      But "onion" is pronouncable and a bona fide English word).

     Creating further onions is intended to be straightforward; the
     following steps show how to add the sedenions but any number of
     onions may be added the same way.

        *  Add functions 'sedenion_prod_single()' and 'sedenion_prod()'
           to 'src/onion.c'.

        *  Update the following functions:

           *  'type()'

           *  'harmonize()'

           *  'as.onion()'

           *  'AprodA()'

        *  create the following functions:

           *  'rsed()' (by analogy with 'roct()' and 'rquat()')

           *  'SprodS()' (by analogy with 'OprodO()' and 'HprodH()')

           *  'R_SprodS()' (by analogy with 'R_OprodO()' and
              'R_HprodH()')

           *  'sedenion()' and 'is.sedenion()' (by analogy with
              'octonion()' and 'is.octonion()')

           *  'as.sedenion()' by analogy with 'as.octonion()'.

           *  a whole bunch of functions (with appropriate names) to
              get and set individual onion components, by analogy with
              'i.quaternion()' and 'i<-.quaternion()'. Sedenions have
              at least two different naming conventions.

     Note that function 'Ops.onion()' need not be changed, as it copes
     with generic onions.

_A_u_t_h_o_r(_s):

     Robin K. S. Hankin

_E_x_a_m_p_l_e_s:

     x <- octonion(Re=1,il=1:3)
     x
     kl(x) <- 100
     x

     as.quaternion(diag(4))

