[an error occurred while processing this directive] [an error occurred while processing this directive]
[an error occurred while processing this directive] Skip to the content of the web site.The C++ classes Trigintaduonion<long double>, Trigintaduonion<double>, and Trigintaduonion<float> represent floating-point trigintaduonion of the form z = a + ib1 + jb2 + kb3 + u1b4 + i1b5 + j1b6 + k1b7 + u2b8 + i2b9 + j2b10 + k2b11 + u3b12 + i3b13 + j2b14 + k2b15 + u4b16 + i4b17 + j4b18 + k4b19 + u5b20 + i5b21 + j5b22 + k5b23 + u6b24 + i6b25 + j6b26 + k6b27 + u7b28 + i7b29 + j7b30 + k7b31.
The symbols i, j, k, u1, i1, j1, ..., k7 follow the multiplication rules shown in Table 1.Table 1. Multiplication rules for trigintaduonion symbols.
× | i | j | k | u1 | i1 | j1 | k1 | u2 | i2 | j2 | k2 | u3 | i3 | j3 | k3 |
i | −1 | k | −j | i1 | −u1 | −k1 | j1 | i2 | −u2 | −k2 | j2 | −i3 | u3 | k3 | −j3 |
j | −k | −1 | i | j1 | k1 | −u1 | −i1 | j2 | k2 | −u2 | −i2 | −j3 | −k3 | u3 | i3 |
k | j | −i | −1 | k1 | −j1 | i1 | −u1 | k2 | −j2 | i2 | −u2 | −k3 | j3 | −i3 | u3 |
u1 | −i1 | −j1 | −k1 | −1 | i | j | k | u3 | i3 | j3 | k3 | −u2 | −i2 | −j2 | −k2 |
i1 | u1 | −k1 | j1 | −i | −1 | −k | j | i3 | −u3 | k3 | −j3 | i2 | −u2 | k2 | −j2 |
j1 | k1 | u1 | −i1 | −j | k | −1 | −i | j3 | −k3 | −u3 | i3 | j2 | −k2 | −u2 | i2 |
k1 | −j1 | i1 | u1 | −k | −j | i | −1 | k3 | j3 | −i3 | −u3 | k2 | j2 | −i2 | −u2 |
u2 | −i2 | −j2 | −k2 | −u3 | −i3 | −j3 | −k3 | −1 | i | j | k | u1 | i1 | j1 | k1 |
i2 | u2 | −k2 | j2 | −i3 | u3 | k3 | −j3 | −i | −1 | −k | j | −i1 | u1 | k1 | −j1 |
j2 | k2 | u2 | −i2 | −j3 | −k3 | u3 | i3 | −j | k | −1 | −i | −j1 | −k1 | u1 | i1 |
k2 | −j2 | i2 | u2 | −k3 | j3 | −i3 | u3 | −k | −j | i | −1 | −k1 | j1 | −i1 | u1 |
u3 | i3 | j3 | k3 | u2 | −i2 | −j2 | −k2 | −u1 | i1 | j1 | k1 | −1 | −i | −j | −k |
i3 | −u3 | k3 | −j3 | i2 | u2 | k2 | −j2 | −i1 | −u1 | k1 | −j1 | i | −1 | k | −j |
j3 | −k3 | −u3 | i3 | j2 | −k2 | u2 | i2 | −j1 | −k1 | −u1 | i1 | j | −k | −1 | i |
k3 | j3 | −i3 | −u3 | k2 | j2 | −i2 | u2 | −k1 | j1 | −i1 | −u1 | k | j | −i | −1 |
Trigintaduonions, having sedenions as a proper subset, are not commutative, associative, nor alternative, and do not form a division algebra.
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.
There are two constructors
Trigintaduonion( T a = 0 ); Trigintaduonion( 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, T b16, T b17, T b18, T b19, T b20, T b21, T b22, T b23, T b24, T b25, T b26, T b27, T b28, T b29, T b30, T b31 );
which create the trigintaduonion a + 0i + 0j + 0k + 0e + 0i1 + 0j1 + 0k1 and a + ib1 + jb2 + kb3 + ub4 + i1b5 + j1b6 + k1b7, respectively.
There are nine static constants defined in each class:
ZERO | 0 |
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[32] = {ONE, I, J, K, U1, I1, J1, K1, U2, I2, J2, K2, U3, I3, J3, K3, U4, I4, J4, K4, U5, I5, J5, K5, U6, I6, J6, K6, U7, I7, J7, K7}.
Each of the real-valued member functions has the prototype T f() const; and has a corresponding procedural function T f( const Trigintaduonion<T> );.
real | imag_i | imag_j | imag_k | imag_u1 | imag_i1 | imag_j1 |
imag_k1 | csgn | abs | norm | abs_imag | norm_imag | arg |
Descriptions of each of the functions follow:
The function T operator [](int n) const returns the coefficient of the unit UNITS[n] for n = 0, 1, 2, ..., 31.
Each of these trigintaduonion-valued member functions has the prototype Trigintaduonion<T> f() const; and has a corresponding procedural function Trigintaduonion<T> f( const Trigintaduonion<T> );.
imag | conj | signum |
Descriptions of each of the functions follow:
Each of the square, square root, and inverse member functions has the prototype Trigintaduonion<T> f() const; and has a corresponding procedural function Trigintaduonion<T> f( const Trigintaduonion<T> );.
sqr | sqrt | inverse |
Descriptions of each of the functions follow:
The member function Trigintaduonion<T> rotate( const Trigintaduonion<T> w ) const; and its associated procedural function Trigintaduonion<T> rotate( const Trigintaduonion<T> z, const Trigintaduonion<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).
The power function is overloaded with two prototypes:
Trigintaduonion<T> pow( T ) | Trigintaduonion<T> pow( Trigintaduonion<T> ) |
Each of the exponential and logarithmic member functions has the prototype Trigintaduonion<T> f() const; and has a corresponding procedural function Trigintaduonion<T> f( const Trigintaduonion<T> );.
exp | log | log10 |
Descriptions of each of the functions follow:
Each of the trigonometric, hyperbolic, inverse trigonometric, and inverse hyperbolic member functions has the prototype Trigintaduonion<T> f() const; and has a corresponding procedural function Trigintaduonion<T> f( const Trigintaduonion<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 z − z3/3! + z5/5! − z7/7! + z9/9! − z11/11! + ⋅⋅⋅ by using the formula
Bessel functions of the first kind, Jn(z) are implemented for integer values of n. The prototype of the member function is Trigintaduonion<T> bessel_J( int ) const; and there is the corresponding procedural function Trigintaduonion<T> bessel_J( int, const Trigintaduonion<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 trigintaduonions.
Each of the integer-valued member functions has the prototype Trigintaduonion<T> f() const; and has a corresponding procedural function Trigintaduonion<T> f( const Trigintaduonion<T> );.
floor | ceil |
In both cases, the floor and ceiling, respectively, are calculated for each component.
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 trigintaduonion coefficients, hence the coefficients are restricted to real values.
Trigintaduonion<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 *.
Trigintaduonion<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.
All binary arithmetic operators operator ⋅ have the following prototypes:
operator ⋅ ( const Trigintaduonion<T> &, const Trigintaduonion<T> & ), operator ⋅ ( T, const Trigintaduonion<T> & ), and operator ⋅ ( const Trigintaduonion<T> &, T ). The standard operations are:+ | - | * | / |
Note that z/w is defined as zw-1.
The unary arithmetic operator operator - has the prototype operator - ( const Trigintaduonion<T> & ) and returns the negative of the trigintaduonion.
The assignment operators operator ⋅ have the prototypes operator ⋅ ( const Trigintaduonion<T> & ) and operator ⋅ ( T ) and appropriately modifies and returns this trigintaduonion. The operations are:
= | += | -= | *= | /= |
The auto increment and auto decrement operators work on the real part of the trigintaduonion.
All binary Boolean operators have the following prototypes:
operator ⋅ ( const Trigintaduonion<T> &, const Trigintaduonion<T> & ), operator ⋅ ( T, const Trigintaduonion<T> & ), and operator ⋅ ( const Trigintaduonion<T> &, T ). The standard operations are:== | != |
Descriptions of each of the functions follow:
Each of the following member functions has the prototype bool f() const; and returns a value based on the components of this trigintaduonion.
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:
Each of the following static factory functions has the prototype static Trigintaduonion<T> f() const; and returns a random trigintaduonion according to the following definitions:
where rk is a random real value.
The stream operators have been overloaded to print and read trigintaduonion.