onion-package             package:onion             R Documentation

_M_a_n_i_p_u_l_a_t_i_o_n _o_f _q_u_a_t_e_r_n_i_o_n_s _a_n_d _o_c_t_o_n_i_o_n_s

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

     There are precisely four normed division algebras over the reals:
     the reals themselves, the complex numbers, the quaternions, and
     the octonions.  The R system is well equipped to deal with the
     first two: the 'onion' package provides some functionality for the
     third and fourth.

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


       Package:  onion
       Type:     Package
       Version:  1.0
       Date:     2007-05-01
       License:  GPL

     The package is intended to provide transparent access to
     quaternions and octonions.

     Package currently S3 but will use S4 methods shortly

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

     Robin K. S. Hankin

     Maintainer: r.hankin@noc.soton.ac.uk

_R_e_f_e_r_e_n_c_e_s:

     R News article

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

     as.quaternion(1:10)  # quaternionic vector with zero imaginary components

     1:10 + Hj  # Simple nontrivial quaternion; note appropriate behaviour of '+'

     1:10 + Oil   # simple octonionic vector ('Oil' is one of the octonionic bases). 

     a <- rquat(5) 
     b <- rquat(5)  #Quaternionic vectors with random integer components

     a*b - b*a     # Nonzero!  (quaternions are not commutative)

     Re(a)  #  Re() extracts the real component

     i(a) <- 1000 ; a  # individual components may be manipulated intuitively

     as.octonion(a)  # 'upgrades' to octonion

     x <- roct(5)  # random octonionic vector with integer components
     y <- roct(5)
     z <- roct(5)

     (x*y)*z - z*(y*z)  # Nonzero!  (octonions are not associative)

     Norm(x)
     Mod(x)  # Modulus and Norm work as expected

     # Now some plotting:

     a <- as.octonion(c(7,8,3,3,7,1,3,3),single=TRUE)
     b <- as.octonion(c(8,4,2,8,3,7,3,7),single=TRUE)
     plot(exp(seq(from=a,to=b,len=50)))
     # Note operation of seq(), exp(), and plot()

