Skip to the content of the web site.

Sedenions

The C++ classes Sedenion<long double>, Sedenion<double>, and Sedenion<float> represent floating-point sedenions of the form z = a + ib1 + jb2 + kb3 + u1b4 + i1b5 + j1b6 + k1b7 + u2b8 + i2b9 + j2b10 + k2b11 + u3b12 + i3b13 + j3b14 + k3b15.

The symbols i, j, k, u1, i1, j1, k1, u2, i2, j2, k2, u3, i3, j3, and k3 follow the multiplication rules shown in Table 1.

Table 1. Multiplication rules for sedenion symbols.

×ijku1i1j1k1u2i2j2k2u3i3j3k3
i−1kji1u1k1j1i2u2k2j2i3u3k3j3
jk−1ij1k1u1i1j2k2u2i2j3k3u3i3
kji−1k1j1i1u1k2j2i2u2k3j3i3u3
u1i1j1k1−1ijku3i3j3k3u2i2j2k2
i1u1k1j1i−1kji3u3k3j3i2u2k2j2
j1k1u1i1jk−1ij3k3u3i3j2k2u2i2
k1j1i1u1kji−1k3j3i3u3k2j2i2u2
u2i2j2k2u3i3j3k3−1ijku1i1j1k1
i2u2k2j2i3u3k3j3i−1kji1u1k1j1
j2k2u2i2j3k3u3i3jk−1ij1k1u1i1
k2j2i2u2k3j3i3u3kji−1k1j1i1u1
u3i3j3k3u2i2j2k2u1i1j1k1−1ijk
i3u3k3j3i2u2k2j2i1u1k1j1i−1kj
j3k3u3i3j2k2u2i2j1k1u1i1jk−1i
k3j3i3u3k2j2i2u2k1j1i1u1kji−1

Sedenions no longer form a division algebra, as there exist zero divisors: for example

(i + j2)×(i3j1) = 0.

We can also use this example to construct a counter-example to show that sedenions are not even alternative, that is, it is not true that (wz)z = w(z2). Consider

((i + j2)×(i3j1)) × (i3j1) = 0,

because the first product is a zero divisor, however:

(i + j2)×(i3j1)2 = (i + j2) × (−2) = −2i − 2j2

This is because any purely-imaginary sedenion z has the property that z2 = -|z|2.

Throughout this document, the variable z is used to represent *this object. The choice of u over e for the additional symbol relates mostly to the special nature of e in printing doubles. The template variable T represents the field of the coefficients.

Index



Constructors

There are two constructors

     Sedenion( T a = 0 );
     Sedenion( T a, T b1, T b2, T b3, T b4, T b5, T b6, T b7,
	T b8, T b9, T b10, T b11, T b12, T b13, T b14, T b15 );

which create the sedenions a + 0i + 0j + 0k + 0u1 + ⋅⋅⋅ + 0k3 and a + ib1 + jb2 + kb3 + u1b4 + ⋅⋅⋅ + k3b15, respectively.



Constants

There are nine static constants defined in each class:

ZERO0
ONE 1
I i
J j
K k
U1 u1
I1 i1
J1 j1
K1 k1
U2 u2
I2 i2
J2 j2
K2 k2
U3 u3
I3 i3
J3 j3
K3 k3

The constants may be accessed through the array UNITS[16] = {ONE, I, J, K, U1, I1, J1, K1, U2, I2, J2, K2, U3, I3, J3, K3}.



Real-Valued Functions

Each of the real-valued member functions has the prototype T f() const; and has a corresponding procedural function T f( const Sedenion<T> );.

real imag_i imag_j imag_k imag_u1 imag_i1 imag_j1 imag_k1 imag_u2 imag_i2 imag_j2
imag_k2 imag_u3 imag_i3 imag_j3 imag_k3 csgn abs norm abs_imag norm_imag arg

Descriptions of each of the functions follow:

real
Return the real component ℜ(z) = a.
imag_i
Return the imaginary component ℑi(z) = b1.
imag_j
Return the imaginary component ℑj(z) = b2.
imag_k
Return the imaginary component ℑk(z) = b3.
imag_u1
Return the imaginary component ℑu1(z) = b4.
imag_i1
Return the imaginary component ℑi1(z) = b5.
imag_j1
Return the imaginary component ℑj1(z) = b6.
imag_k1
Return the imaginary component ℑk1(z) = b7.
imag_u2
Return the imaginary component ℑu2(z) = b8.
imag_i2
Return the imaginary component ℑi2(z) = b9.
imag_j2
Return the imaginary component ℑj2(z) = b10.
imag_k2
Return the imaginary component ℑk2(z) = b11.
imag_u3
Return the imaginary component ℑu3(z) = b12.
imag_i3
Return the imaginary component ℑi3(z) = b13.
imag_j3
Return the imaginary component ℑj3(z) = b14.
imag_k3
Return the imaginary component ℑk3(z) = b15.
csgn
Return 0 if z = 0, 1 if a ≥ +0, and -1 if a ≤ -0.
abs
Return |z| = (zz*)½ unless either component is infinity, in which case, it always returns ∞.
norm
Returns |z|2 = zz* unless any component is infinity, in which case, it always returns ∞.
abs_imag
Returns the absolute value of the imaginary part of the sedenion: |ℑ(z)| = (-ℑ(z)2)½.
norm_imag
Returns |ℑ(z)|2 = -ℑ(z)2.
arg
Return the argument of the sedenion arg(z) = atan2( |ℑ(z)|, ℜ(z) ).

The function T operator [](int n) const returns the coefficient of the unit UNITS[n] for n = 0, 1, 2, ..., 15.



Sedenion-Valued Functions

Each of these sedenion-valued member functions has the prototype Sedenion<T> f() const; and has a corresponding procedural function Sedenion<T> f( const Sedenion<T> );.

imag conj signum

Descriptions of each of the functions follow:

imag
Return the sedenion 0 + ib1 + jb2 + ⋅⋅⋅ + k3b15.
cong
Return the sedenion z* = aib1jb2 − ⋅⋅ − k3b15.
signum
Return the sedenion z/|z| given z ≠ 0. If z = 0, then z is returned.


Squares and Inverses

Each of the square, square root, and inverse member functions has the prototype Sedenion<T> f() const; and has a corresponding procedural function Sedenion<T> f( const Sedenion<T> );.

sqr sqrt inverse

Descriptions of each of the functions follow:

sqr
Calculate z2.
sqrt
Calculate the square root of z (that is, z½).
inverse
Calculate the inverse of z (that is, z-1).


Rotations

The member function Sedenion<T> rotate( const Sedenion<T> w ) const; and its associated procedural function Sedenion<T> rotate( const Sedenion<T> z, const Sedenion<T> w ) calculates wzw*. If w has unit length and z is an imaginary quaternion, then this member function returns vector z rotated 2 arg(w) radians around the line defined by ℑ(w).



Powers

The power function is overloaded with two prototypes:

Sedenion<T> pow( T ) Sedenion<T> pow( Sedenion<T> )
These calculate z raised to the power of the given argument. There are corresponding procedural functions Sedenion<T> pow( const Sedenion<T>, T ); and Sedenion<T> pow( const Sedenion<T>, const Sedenion<T> );.



Exponential and Logarithmic Functions

Each of the exponential and logarithmic member functions has the prototype Sedenion<T> f() const; and has a corresponding procedural function Sedenion<T> f( const Sedenion<T> );.

exp log log10

Descriptions of each of the functions follow:

exp
Calculate ez.
log
Calculate the natural logarithm ln(z).
log10
Calculate the base-10 logarithm log10(z).

As with octonions, because of the loss of associativity, unless x and y commute, exp(x + y) ≠ exp(x)exp(y), log(xy) ≠ log(x) + log(y), and log10(xy) ≠ log10(x) + log10(y).



Trigonometric and Hyperbolic Functions (and their Inverses)

Each of the trigonometric, hyperbolic, inverse trigonometric, and inverse hyperbolic member functions has the prototype Sedenion<T> f() const; and has a corresponding procedural function Sedenion<T> f( const Sedenion<T> );.

 sin   cos   tan   sec   csc   cot 
 sinh  cosh  tanh  sech  csch  coth
asin  acos  atan  asec  acsc  acot 
asinh acosh atanh asech acsch acoth

For example, the sin function calculates the result of zz3/3! + z5/5! − z7/7! + z9/9! − z11/11! + ⋅⋅⋅ by using the formula

sin(z) = sin(a) cosh(|ℑ(z)|) + signum( ℑ(z) ) cos(a) sinh(|ℑ(z)|)


Special Functions

Bessel functions of the first kind, Jn(z) are implemented for integer values of n. The prototype of the member function is Sedenion<T> bessel_J( int ) const; and there is the corresponding procedural function Sedenion<T> bessel_J( int, const Sedenion<T>) const;.

Because the coefficients of the Taylor series for Bessel functions of the first kind are real, this function is well defined even for the non-commutative sedenions.



Integer-Value Functions

Each of the integer-valued member functions has the prototype Sedenion<T> f() const; and has a corresponding procedural function Sedenion<T> f( const Sedenion<T> );.

floor ceil

In both cases, the floor and ceiling, respectively, are calculated for each component.



Horner's Rule

The polynomial v0zn − 1 + v1zn − 2 + v2zn − 3 + ⋅⋅⋅ vn − 3z2 + vn − 2z + vn − 1 may be calculated efficiently using Horner's rule. The array v of n entries may be of type T *. The lack of commutativity dictates that the polynomial is not well defined from sedenionic coefficients, hence the coefficients are restricted to real values.

     Sedenion<T> horner( T * v, unsigned int n );

The Newton polynomial with offsets:       v0(z − cn − 1)(z − cn − 2)⋅⋅⋅(z − c3)(z − c2)(z − c1) +
      v1(z − cn − 1)(z − cn − 2)⋅⋅⋅(z − c3)(z − c2) +
      v2(z − cn − 1)(z − cn − 2)⋅⋅⋅(z − c3) + ⋅⋅⋅ +
  vn − 3(z − cn − 1)(z − cn − 2) +
  vn − 2(z − cn − 1) +
  vn − 1 may also be calculated efficiently using Horner's rule. The arrays v and c of n entries must be of type T *.

     Sedenion<T> horner( T * v, T * c, unsigned int n );

Similarly, due to commutativity, the coefficients and the offsets must be restricted to real values.

Corresponding to each of this functions is a procedural function which takes the variable z as a first argument.



Binary Arithmetic Operators

All binary arithmetic operators operator ⋅ have the following prototypes:

operator ⋅ ( const Sedenion<T> &, const Sedenion<T> & ), operator ⋅ ( T, const Sedenion<T> & ), and operator ⋅ ( const Sedenion<T> &, T ). The standard operations are:

+ - * /

Note that z/w is defined as zw-1.



Unary Arithmetic Operators

The unary arithmetic operator operator - has the prototype operator - ( const Sedenion<T> & ) and returns the negative of the sedenion.



Assignment Operators

The assignment operators operator ⋅ have the prototypes operator ⋅ ( const Sedenion<T> & ) and operator ⋅ ( T ) and appropriately modifies and returns this sedenion. The operations are:

= += -= *= /=


Auto Increment and Auto Decrement Operators

The auto increment and auto decrement operators work on the real part of the sedenion.



Binary Boolean Operators

All binary Boolean operators have the following prototypes:

operator ⋅ ( const Sedenion<T> &, const Sedenion<T> & ), operator ⋅ ( T, const Sedenion<T> & ), and operator ⋅ ( const Sedenion<T> &, T ). The standard operations are:

== !=

Descriptions of each of the functions follow:

operator ==
Returns true if all components return true under ==.
operator !=
Returns true if any components return true under !=.


Query Functions

Each of the following member functions has the prototype bool f() const; and returns a value based on the components of this sedenion.

is_imaginary is_inf is_nan is_neg_inf
is_pos_inf is_real is_real_inf is_zero

Descriptions of each of the functions follow:

is_imaginary
Returns true if this sedenion has a zero real component (of the form 0 + ib1 + jb2 + ⋅⋅⋅ k3b15) and false otherwise.
is_inf
Returns true if any component of this is one of either +∞ or -∞ and false otherwise.
is_nan
Returns true if any component of this is NaN and false otherwise.
is_neg_inf
Returns true if this sedenion is -∞ + 0i + 0j + ⋅⋅⋅ + 0k3 and false otherwise.
is_pos_inf
Returns true if this sedenion is ∞ + 0i + 0j + ⋅⋅⋅ + 0k3 and false otherwise.
is_real
Returns true if this sedenion has a zero imaginary component (of the form a + 0i + ⋅⋅⋅ + 0k3) and false otherwise.
is_real_inf
Returns true if this sedenion is either +∞ + 0i + 0j + ⋅⋅⋅ + 0k3 or -∞ + 0i + 0j + ⋅⋅⋅ + 0k3 and false otherwise.
is_zero
Returns true if this sedenion is 0 + 0i + 0j + ⋅⋅⋅ + 0k3 and false otherwise.


Static Factory Functions

Each of the following static factory functions has the prototype static Sedenion<T> f() const; and returns a random sedenion according to the following definitions:

random
r1 + ir2 + jr3 + kr4 + u1r5 + ⋅⋅⋅ + k3r16
random_real
r1 + 0i + 0j + ⋅⋅⋅ + 0k1.
random_imag
0 + ir2 + jr3 + kr4 + u1r5 + ⋅⋅⋅ + k3r16

where rk is a random real value.



Stream Operators

The stream operators have been overloaded to print and read sedenions.