ca.uwaterloo.alumni.dwharder.Numbers
Class Sedenion

java.lang.Object
  extended by ca.uwaterloo.alumni.dwharder.Numbers.Sedenion
All Implemented Interfaces:
java.io.Serializable

public final class Sedenion
extends java.lang.Object
implements java.io.Serializable

A class implementing sedenions using sixteen doubles.

This package allows the user to construct, manipulate, and model with sedenions. A sedenion is of the form a0 + ia1 + ja2 + ka3 + e'a4 + i'a5 + j'a6 + k'a7 + e''a8 + i''a9 + j''a10 + k''a11 + e'''a12 + i'''a13 + j'''a14 + k'''a15 where each an is a real numbers. The symbols i, j, k, e', i', j', k', e'', i'', j'', k'', e''', i''', j''', k''' commute with real numbers and obey the multiplication rules i2 = j2 = k2 = e'2 = i'2 = j'2 = k'2 = e''2 = i''2 = j''2 = k''2 = e'''2 = i'''2 = j'''2 = k'''2 = -1, ij = k, ie' = i', je' = j', ke' = k', ie'' = i'', je'' = j'', ke'' = k'', ie''' = i''', je''' = j''', and ke''' = k'''.

Sedenions are neither commutative nor associative (containing octonions), nor are they alternative; for example (i + e''')((i + e''') j) = -2j + 2k''' ≠ -2j = (i + e''')2 j. Additionally, the norm is no longer a algebraic, for exmaple, |(i + j'')(e' + k''')|2 = 8 > 4 = |i +j''|2 |e' + k'''|2, and there exist zero divisors.

In the description of each non-static method, this sedenion is represented by s = a0 + ia1 + ja2 + ka3 + e'a4 + i'a5 + j'a6 + k'a7 + e''a8 + i''a9 + j''a10 + k''a11 + e'''a12 + i'''a13 + j'''a14 + k'''a15. a0 and ia1 + ja2 + ka3 + e'a4 + i'a5 + j'a6 + k'a7 + e''a8 + i''a9 + j''a10 + k''a11 + e'''a12 + i'''a13 + j'''a14 + k'''a15 are the real and imaginary parts of s, respectively. The real numbers an are the coefficients of the sedenion s. The components a0, ia1, ..., k'''a15 will be referred to as the 0th, 1st, ..., and 17th terms of the sedenion s, respectively.

Any other sedenion is represented by t = b0 + ib1 + jb2 + kb3 + e'b4 + i'b5 + j'b6 + k'b7 + e''b8 + i''b9 + j''b10 + k''b11 + e'''b12 + i'''b13 + j'''b14 + k'''b15. The variables x and n are used to represent real numbers and integers, respectively.

In reference to methods which must deal with branch cuts, the symbol u refers to any unit imaginary sedenion (real(u) = 0 and |u| = 1).

Instances of this class are immutable.

This class returns correct answers on branch cuts. Additionally, this class tries to give reasonable treatment to ∞ and NaN. For example, ONE.multiply(Double.POSITIVE_INFINITY) returns ∞ + i0 + ... + k'''0. Most implementations would return ∞ + iNaN + ... + k'''NaN because they would simply multiply each coefficient by the multiplier. This is probably not the desired result.

This class is based on the methods found in the Java classes Double, Math, and java.math.BigDecimal.

There is very little interaction between between the classes in this package. If there is a significant request for such behaviour, it will be added (seemlessly) in the future.

Since:
JDK 5.0
Version:
1.0beta 22-Mar-2005
Author:
Douglas Wilhelm Harder, Department of Electrical and Computer Engineering, University of Waterloo
See Also:
Double, Math, Serialized Form

Field Summary
static Sedenion E1
          The constant e'.
static Sedenion E2
          The constant e''.
static Sedenion E3
          The constant e'''.
static Sedenion I
          The constant i.
static Sedenion I1
          The constant i'.
static Sedenion I2
          The constant i''.
static Sedenion I3
          The constant i'''.
static Sedenion J
          The constant j.
static Sedenion J1
          The constant j'.
static Sedenion J2
          The constant j''.
static Sedenion J3
          The constant j'''.
static Sedenion K
          The constant k.
static Sedenion K1
          The constant k'.
static Sedenion K2
          The constant k''.
static Sedenion K3
          The constant k'''.
static Sedenion NaN
          The constant NaN + iNaN + jNaN + kNaN + e'NaN + i'NaN + j'NaN + k'NaN + e''NaN + i''NaN + j''NaN + k''NaN + e'''NaN + i'''NaN + j'''NaN + k'''NaN.
static Sedenion ONE
          The constant 1.
static Sedenion ZERO
          The constant 0.
 
Constructor Summary
Sedenion(double a0)
          Generates the sedenion a0 + i0 + j0 + k0 + e'0 + i'0 + j'0 + k'0 + e''0 + i''0 + j''0 + k''0 + e'''0 + i'''0 + j'''0 + k'''0.
Sedenion(double[] v)
          Generates a sedenion based on the entries of the array v.
Sedenion(double x, double[] v)
          Generates the sedenion x + iv1 + jv2 + kv3 + e'v4 + i'v5 + j'v6 + k'v7 + e''v8 + i''v9 + j''v10 + k''v11 + e'''v12 + i'''v13 + j'''v14 + k'''v15.
Sedenion(double a1, double a2, double a3, double a4, double a5, double a6, double a7, double a8, double a9, double a10, double a11, double a12, double a13, double a14, double a15)
          Generates the imaginary sedenion ia1 + ja2 + ka3 + e'a4 + i'a5 + j'a6 + k'a7 + e''a8 + i''a9 + j''a10 + k''a11 + e'''a12 + i'''a13 + j'''a14 + k'''a15.
Sedenion(double a0, double a1, double a2, double a3, double a4, double a5, double a6, double a7, double a8, double a9, double a10, double a11, double a12, double a13, double a14, double a15)
          Generates the sedenion a0 + ia1 + ja2 + ka3 + e'a4 + i'a5 + j'a6 + k'a7 + e''a8 + i''a9 + j''a10 + k''a11 + e'''a12 + i'''a13 + j'''a14 + k'''a15.
 
Method Summary
 double abs()
          Returns the absolute value of this sedenion s.
 double abs2()
          Returns the square of the absolute value of this sedenion s.
 double abs2Imag()
          Returns the square of the absolute value of the imaginary part of this sedenion s.
 double absImag()
          Returns the absolute value of the imaginary part of this sedenion s.
 Sedenion acos()
          Returns the principal inverse cosine of this sedenion s.
 Sedenion acos(Sedenion u)
          Returns the principal inverse cosine of this sedenion s.
 Sedenion acosh()
          Returns the principal inverse hyperbolic cosine of this sedenion s.
 Sedenion acosh(Sedenion u)
          Returns the principal inverse hyperbolic cosine of this sedenion s.
 Sedenion acot()
          Returns the principal inverse cotangent of this sedenion s.
 Sedenion acot(Sedenion u)
          Returns the principal inverse cotangent of this sedenion s.
 Sedenion acoth()
          Returns the principal inverse hyperbolic cotangent of this sedenion s.
 Sedenion acoth(Sedenion u)
          Returns the principal inverse hyperbolic cotangent of this sedenion s.
 Sedenion acsc()
          Returns the principal inverse cosecant of this sedenion s.
 Sedenion acsc(Sedenion u)
          Returns the principal inverse cosecant of this sedenion s.
 Sedenion acsch()
          Returns the principal inverse hyperbolic cosecant of this sedenion s.
 Sedenion acsch(Sedenion u)
          Returns the principal inverse hyperbolic cosecant of this sedenion s.
 Sedenion add(double x)
          Returns the sum of this sedenion s and the real number x.
 Sedenion add(int n, double x)
          Returns this sedenian s with x added onto its nth term.
 Sedenion add(Sedenion t)
          Returns the sum of this sedenion s and the sedenion t = b0 + ib1 + jb2 + kb3 + e'b4 + i'b5 + j'b6 + k'b7 + e''b8 + i''b9 + j''b10 + k''b11 + e'''b12 + i'''b13 + j'''b14 + k'''b15.
 double argument()
          Returns the argument of this sedenion s.
 Sedenion asec()
          Returns the principal inverse secant of this sedenion s.
 Sedenion asec(Sedenion u)
          Returns the principal inverse secant of this sedenion s.
 Sedenion asech()
          Returns the principal inverse hyperbolic secant of this sedenion s.
 Sedenion asech(Sedenion u)
          Returns the principal inverse hyperbolic secant of this sedenion s.
 Sedenion asin()
          Returns the principal inverse sine of this sedenion s.
 Sedenion asin(Sedenion u)
          Returns the principal inverse sine of this sedenion s.
 Sedenion asinh()
          Returns the principal inverse hyperbolic sine of this sedenion s.
 Sedenion asinh(Sedenion u)
          Returns the principal inverse hyperbolic sine of this sedenion s.
 Sedenion atan()
          Returns the principal inverse tangent of this sedenion s.
 Sedenion atan(Sedenion u)
          Returns the principal inverse tangent of this sedenion s.
 Sedenion atanh()
          Returns the principal inverse hyperbolic tangent of this sedenion s.
 Sedenion atanh(Sedenion u)
          Returns the principal inverse hyperbolic tangent of this sedenion s.
 Sedenion ceil()
          Returns the ceiling of each of the coefficients of this sedenion s.
 double coefficient(int n)
          Returns the coefficient of the nth term of this sedenion s.
 Sedenion conjugate()
          Returns the conjugate of this sedenion s.
 Sedenion cos()
          Returns the cosine of this sedenion s.
 Sedenion cosh()
          Returns the hyperbolic cosine of this sedenion s.
 Sedenion cot()
          Returns the cotangent of this sedenion s.
 Sedenion coth()
          Returns the hyperbolic cotangent of this sedenion s.
 Sedenion csc()
          Returns the cosecant of this sedenion s.
 Sedenion csch()
          Returns the hyperbolic cosecant of this sedenion s.
 Sedenion divide(Sedenion t)
          Returns the quotient of this sedenion s over the sedenion t = b0 + ib1 + jb2 + kb3 + e'b4 + i'b5 + j'b6 + k'b7 + e''b8 + i''b9 + j''b10 + k''b11 + e'''b12 + i'''b13 + j'''b14 + k'''b15.
 boolean equals(java.lang.Object t)
          Returns true if this sedenion s equals the sedenion t = b0 + ib1 + jb2 + kb3 + e'b4 + i'b5 + j'b6 + k'b7 + e''b8 + i''b9 + j''b10 + k''b11 + e'''b12 + i'''b13 + j'''b14 + k'''b15.
 boolean equals(java.lang.Object t, double eps)
          Returns true if this sedenion s equals the sedenion t = b0 + ib1 + jb2 +...+ k'''b15.
 Sedenion exp()
          Returns Euler's number (e) raised to the power of this sedenion s.
 Sedenion floor()
          Returns the floor of each of the coefficients of this sedenion s.
 int hashCode()
          Returns a hash code for the this sedenion s based on the coefficients.
 Sedenion horner(double[] v)
          Evaluate the polynomial with real coefficients, given by the array of doubles v, at this sedenion s.
 Sedenion imag()
          Returns the imaginary part of this sedenion s.
static java.lang.String[] imaginaryUnits(java.lang.String[] units)
          Set the strings to be used for the fifteen imaginary units.
 boolean isImaginary()
          Returns true if the real part of this sedenion s is zero and false otherwise.
 boolean isImaginary(int n)
          Returns true if the nth imaginary coefficient of this octonian s is the only non-zero coefficient and false otherwise.
 boolean isInfinite()
          Returns true if any coefficient of this sedenion s is infinite and false otherwise.
 boolean isNaN()
          Returns true if any coefficient of this sedenion s is not-a-number (NaN) and false otherwise.
 boolean isReal()
          Returns true if all the coefficients of the imaginary part of this sedenion s are zero, otherwise false.
 boolean isZero()
          Returns true if all coefficients of this sedenion s are zero, otherwise false.
 Sedenion log()
          Returns the natural logarithm of this sedenion s.
 Sedenion log(Sedenion u)
          Returns the natural logarithm of this sedenion s.
 Sedenion log10()
          Returns the logarithm base 10 of this sedenion s.
 Sedenion log10(Sedenion u)
          Returns the natural logarithm of this sedenion s.
 Sedenion multiply(double x)
          Returns the product of this sedenion s and the real number x.
 Sedenion multiply(Sedenion t)
          Returns the product of this sedenion s and the sedenion t = b0 + ib1 + jb2 + kb3 + e'b4 + i'b5 + j'b6 + k'b7 + e''b8 + i''b9 + j''b10 + k''b11 + e'''b12 + i'''b13 + j'''b14 + k'''b15.
 Sedenion negate()
          Returns the negative of this sedenion s.
 Sedenion pow(double x)
          Returns this sedenion s raised to the real number x.
 Sedenion pow(int n)
          Returns this sedenion s raised to the integer n.
 Sedenion pow(Sedenion t)
          Returns this sedenion s raised to the sedenion t.
 Sedenion project(boolean[] v)
          Project this sedenion s onto the subspace defined by the boolean vector v.
 Sedenion project(int n)
          Project this sedenion s onto the nth term.
static Sedenion random()
          A factory method for constructing an sedenion with random real and imaginary parts.
 Sedenion random(boolean[] v)
          A factory method to create a random sedenion defined by the boolean vector v.
static Sedenion random(int n)
          A factory method for constructing a complex number with random nth coefficient.
static Sedenion randomImaginary()
          A factory method for constructing a random imaginary sedenion.
static Sedenion randomReal()
          A factory method for constructing an sedenion with random real part.
 double real()
          Returns the real part of this sedenion s.
 Sedenion rint()
          Returns each coefficient of the sedenion s rounded to the nearest double equal to an integer.
 Sedenion sec()
          Returns the secant of this sedenion s.
 Sedenion sech()
          Returns the hyperbolic secant of this sedenion s.
 Sedenion signum()
          Returns a normalized form of this sedenion s when it is non-zero and s otherwise.
 Sedenion sin()
          Returns the sine of this sedenion s.
 Sedenion sinh()
          Returns the hyperbolic sine of this sedenion s.
 Sedenion sqr()
          Returns the square of this sedenion s.
 Sedenion sqrt()
          Returns the square root of this sedenion s.
 Sedenion sqrt(Sedenion u)
          Returns the square root of this sedenion s.
 Sedenion subtract(Sedenion t)
          Returns the difference between this sedenion s and the sedenion t = b0 + ib1 + jb2 + kb3 + e'b4 + i'b5 + j'b6 + k'b7 + e''b8 + i''b9 + j''b10 + k''b11 + e'''b12 + i'''b13 + j'''b14 + k'''b15.
 Sedenion tan()
          Returns the tangent of this sedenion s.
 Sedenion tanh()
          Returns the hyperbolic tangent of this sedenion s.
 double[] toArray()
          Converts this sedenion s in to an array of four doubles.
 double[] toArray(byte[] v)
          Convert this sedenion o to an array of doubles.
 double[] toImagArray()
          Converts the imaginary part of this sedenion s in to an array of three doubles.
 java.lang.String toString()
          Returns a string representing this sedenion s.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ZERO

public static final Sedenion ZERO
The constant 0.


ONE

public static final Sedenion ONE
The constant 1.


I

public static final Sedenion I
The constant i.


J

public static final Sedenion J
The constant j.


K

public static final Sedenion K
The constant k.


E1

public static final Sedenion E1
The constant e'.


I1

public static final Sedenion I1
The constant i'.


J1

public static final Sedenion J1
The constant j'.


K1

public static final Sedenion K1
The constant k'.


E2

public static final Sedenion E2
The constant e''.


I2

public static final Sedenion I2
The constant i''.


J2

public static final Sedenion J2
The constant j''.


K2

public static final Sedenion K2
The constant k''.


E3

public static final Sedenion E3
The constant e'''.


I3

public static final Sedenion I3
The constant i'''.


J3

public static final Sedenion J3
The constant j'''.


K3

public static final Sedenion K3
The constant k'''.


NaN

public static final Sedenion NaN
The constant NaN + iNaN + jNaN + kNaN + e'NaN + i'NaN + j'NaN + k'NaN + e''NaN + i''NaN + j''NaN + k''NaN + e'''NaN + i'''NaN + j'''NaN + k'''NaN.

Constructor Detail

Sedenion

public Sedenion(double a0,
                double a1,
                double a2,
                double a3,
                double a4,
                double a5,
                double a6,
                double a7,
                double a8,
                double a9,
                double a10,
                double a11,
                double a12,
                double a13,
                double a14,
                double a15)

Generates the sedenion a0 + ia1 + ja2 + ka3 + e'a4 + i'a5 + j'a6 + k'a7 + e''a8 + i''a9 + j''a10 + k''a11 + e'''a12 + i'''a13 + j'''a14 + k'''a15.

Parameters:
a0 - the real part
a1 - the coefficient of i
a2 - the coefficient of j
a3 - the coefficient of k
a4 - the coefficient of e'
a5 - the coefficient of i'
a6 - the coefficient of j'
a7 - the coefficient of k'
a8 - the coefficient of e''
a9 - the coefficient of i''
a10 - the coefficient of j''
a11 - the coefficient of k''
a12 - the coefficient of e'''
a13 - the coefficient of i'''
a14 - the coefficient of j'''
a15 - the coefficient of k'''

Sedenion

public Sedenion(double a0)

Generates the sedenion a0 + i0 + j0 + k0 + e'0 + i'0 + j'0 + k'0 + e''0 + i''0 + j''0 + k''0 + e'''0 + i'''0 + j'''0 + k'''0.

Parameters:
a0 - the real part

Sedenion

public Sedenion(double a1,
                double a2,
                double a3,
                double a4,
                double a5,
                double a6,
                double a7,
                double a8,
                double a9,
                double a10,
                double a11,
                double a12,
                double a13,
                double a14,
                double a15)

Generates the imaginary sedenion ia1 + ja2 + ka3 + e'a4 + i'a5 + j'a6 + k'a7 + e''a8 + i''a9 + j''a10 + k''a11 + e'''a12 + i'''a13 + j'''a14 + k'''a15.

Parameters:
a1 - the coefficient of i
a2 - the coefficient of j
a3 - the coefficient of k
a4 - the coefficient of e'
a5 - the coefficient of i'
a6 - the coefficient of j'
a7 - the coefficient of k'
a8 - the coefficient of e''
a9 - the coefficient of i''
a10 - the coefficient of j''
a11 - the coefficient of k''
a12 - the coefficient of e'''
a13 - the coefficient of i'''
a14 - the coefficient of j'''
a15 - the coefficient of k'''

Sedenion

public Sedenion(double[] v)

Generates a sedenion based on the entries of the array v.

An array v of length 16 defines the sedenion v0 + iv1 + jv2 + kv3 + e'v4 + i'v5 + j'v6 + k'v7 + e''v8 + i''v9 + j''v10 + k''v11 + e'''v12 + i'''v13 + j'''v14 + k'''v15, and

An array v of length 15 defines the sedenion 0 + iv1 + jv2 + kv3 + e'v4 + i'v5 + j'v6 + k'v7 + e''v8 + i''v9 + j''v10 + k''v11 + e'''v12 + i'''v13 + j'''v14 + k'''v15, and

Parameters:
v - array of length 15 or 16

Sedenion

public Sedenion(double x,
                double[] v)

Generates the sedenion x + iv1 + jv2 + kv3 + e'v4 + i'v5 + j'v6 + k'v7 + e''v8 + i''v9 + j''v10 + k''v11 + e'''v12 + i'''v13 + j'''v14 + k'''v15.

Parameters:
x - the real part
v - array of length 15
Method Detail

random

public static final Sedenion random()
A factory method for constructing an sedenion with random real and imaginary parts.

Returns:
r0 + ir1 + jr2 + kr3 + e'r4 + i'r5 + j'r6 + k'r7 + e''r8 + i''r9 + j''r10 + k''r11 + e'''r12 + i'''r13 + j'''r14 + k'''r15, where each ri is a random double.
See Also:
Math.random()

random

public static final Sedenion random(int n)

A factory method for constructing a complex number with random nth coefficient.

Returns:
r, ir, jr, kr, e'r, i'r, j'r, k'r, e''r, i''r, j''r, k''r, e'''r, i'''r, j'''r, or k'''r where r is a random double
See Also:
Math.random()

random

public final Sedenion random(boolean[] v)

A factory method to create a random sedenion defined by the boolean vector v.

In the result, the coefficient of the nth term is a random double if vn == true.

Parameters:
v - an array indicating a subspace
Returns:
a random sedenion s
See Also:
Math.random()

randomReal

public static final Sedenion randomReal()

A factory method for constructing an sedenion with random real part.

Returns:
r where r is a random double
See Also:
Math.random()

randomImaginary

public static final Sedenion randomImaginary()
A factory method for constructing a random imaginary sedenion.

Returns:
0 + ir1 + jr2 + kr3 + e'r4 + i'r5 + j'r6 + k'r7 + e''r8 + i''r9 + j''r10 + k''r11 + e'''r12 + i'''r13 + j'''r14 + k'''r15, where each rn is a random double
See Also:
Math.random()

equals

public final boolean equals(java.lang.Object t)

Returns true if this sedenion s equals the sedenion t = b0 + ib1 + jb2 + kb3 + e'b4 + i'b5 + j'b6 + k'b7 + e''b8 + i''b9 + j''b10 + k''b11 + e'''b12 + i'''b13 + j'''b14 + k'''b15.

The sedendions are equal if an = bn for each n.

Note: NaN == NaN returns false but 0.0 == -0.0 returns true.

Overrides:
equals in class java.lang.Object
Returns:
true if the sedenions are equal.

equals

public final boolean equals(java.lang.Object t,
                            double eps)

Returns true if this sedenion s equals the sedenion t = b0 + ib1 + jb2 +...+ k'''b15.

Two nonzero sedenions s and t are equal up to ε if |s - t|/min( |s|, |t| ) < ε.

If s = 0 or t = 0 then we check that |t| < ε or |s| < ε, respectively.

Parameters:
eps - the allowable relative difference: greater than or equal to 0
Returns:
true if the sedenions are approximation equal

hashCode

public final int hashCode()

Returns a hash code for the this sedenion s based on the coefficients.

Overrides:
hashCode in class java.lang.Object

toString

public final java.lang.String toString()

Returns a string representing this sedenion s.

If N0 = abs(a), N1 = abs(b), N2 = abs(c), and N3 = abs(d), then the return value is "[-]N0 (+|-) iN1 (+|-) jN2 (+|-) kN3".

Overrides:
toString in class java.lang.Object
Returns:
a string of the form "a + ib + jc + kd"

imaginaryUnits

public static final java.lang.String[] imaginaryUnits(java.lang.String[] units)

Set the strings to be used for the fifteen imaginary units.

For example, double[] {"i", "j", "k", "e(1)", "i(1)", "j(1)", "k(1)", "e(2)", "i(2)", "j(2)", "k(2)", "e(3)", "i(3)", "j(3)", "k(3)"}.

Returns:
the previously used array of imaginary units

toArray

public final double[] toArray()
Converts this sedenion s in to an array of four doubles.

Returns:
new double[] {a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15}

toArray

public final double[] toArray(byte[] v)

Convert this sedenion o to an array of doubles.

The coefficient placed into the nth entry of the array is determined by vn.

Parameters:
v - an array of 0, 1, 2, ..., or 15, indicating which coefficient is to be placed into the nth entry of the array
Returns:
an array of doubles of coefficients as specified by v

toImagArray

public final double[] toImagArray()
Converts the imaginary part of this sedenion s in to an array of three doubles.

Returns:
new double[] {a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15}

isZero

public final boolean isZero()
Returns true if all coefficients of this sedenion s are zero, otherwise false.

Returns:
true if s is zero

isReal

public final boolean isReal()
Returns true if all the coefficients of the imaginary part of this sedenion s are zero, otherwise false.

Returns:
true if s is real

isImaginary

public final boolean isImaginary()
Returns true if the real part of this sedenion s is zero and false otherwise.

Returns:
true if s is imaginary

isImaginary

public final boolean isImaginary(int n)
Returns true if the nth imaginary coefficient of this octonian s is the only non-zero coefficient and false otherwise.

Returns:
true if s is non-zero in only one component

isNaN

public final boolean isNaN()
Returns true if any coefficient of this sedenion s is not-a-number (NaN) and false otherwise.

Returns:
true if any coefficient of s is NaN
See Also:
Double.isNaN(double)

isInfinite

public final boolean isInfinite()
Returns true if any coefficient of this sedenion s is infinite and false otherwise.

Returns:
true if any coefficient of s is infinite
See Also:
Double.isInfinite(double)

abs

public final double abs()

Returns the absolute value of this sedenion s.

abs(s) = |s| = sqrt(a02 + a12 + a22 + a32 + a42 + a52 + a62 + a72 + a82 + a92 + a102 + a112 + a122 + a132 + a142 + a152).

Special case:

Returns:
|s|

abs2

public final double abs2()

Returns the square of the absolute value of this sedenion s.

abs(s)2 = |s|2 = a02 + a12 + a22 + a32 + a42 + a52 + a62 + a72 + a82 + a92 + a102 + a112 + a122 + a132 + a142 + a152.

Special case:

Returns:
|s|2

absImag

public final double absImag()

Returns the absolute value of the imaginary part of this sedenion s.

abs(imag(s)) = |imag(s)| = sqrt(a12 + a22 + a32 + a42 + a52 + a62 + a72 + a82 + a92 + a102 + a112 + a122 + a132 + a142 + a152).

Special case:

Returns:
|imag(s)|

abs2Imag

public final double abs2Imag()

Returns the square of the absolute value of the imaginary part of this sedenion s.

abs(imag(s))2 = |imag(s)|2 = a12 + a22 + a32 + a42 + a52 + a62 + a72 + a82 + a92 + a102 + a112 + a122 + a132 + a142 + a152.

Special case:

Returns:
|imag(s)|2

real

public final double real()

Returns the real part of this sedenion s.

real(s) = a0.

Returns:
a0
See Also:
project(int)

imag

public final Sedenion imag()

Returns the imaginary part of this sedenion s.

imag(s) = ia1 + ja2 + ka3 + e'a4 + i'a5 + j'a6 + k'a7 + e''a8 + i''a9 + j''a10 + k''a11 + e'''a12 + i'''a13 + j'''a14 + k'''a15.

Returns:
0 + imag(s)

coefficient

public final double coefficient(int n)

Returns the coefficient of the nth term of this sedenion s.

Parameters:
n - the number (0, 1, 2, ..., 15) of the coefficient to return
Returns:
the nth coefficient

project

public final Sedenion project(int n)

Project this sedenion s onto the nth term.

Parameters:
n - the number of term (0, 1, 2, ..., 15) to be projected onto
Returns:
a0, ia1, ja2, ka3, e'a4, i'a5, j'a6, k'a7, e''a8, i''a9, j''a10, k''a11, e'''a12, i'''a13, j'''a14, or k'''a15

project

public final Sedenion project(boolean[] v)

Project this sedenion s onto the subspace defined by the boolean vector v.

In the result, the coefficient of the nth term is set to 0.0 if vn == false.

Parameters:
v - an array indicating the terms to project onto
Returns:
a perpendicular projection of s

conjugate

public final Sedenion conjugate()

Returns the conjugate of this sedenion s.

conjugate(s) = a0 - ia1 - ja2 - ka3 - e'a4 - i'a5 - j'a6 - k'a7 - e''a8 - i''a9 - j''a10 - k''a11 - e'''a12 - i'''a13 - j'''a14 - k'''a15.

Returns:
a0 - ia1 - ja2 -...- k'''a15

argument

public final double argument()

Returns the argument of this sedenion s.

This is a value on the interval [0, &pi]. For non-zero s, if u = imag(s)/|imag(s)| then s = |s|eu argument(s).

argument(s) = atan2( |imag(s)|, a ).

Returns:
atan2( |imag(s)|, a )

signum

public final Sedenion signum()

Returns a normalized form of this sedenion s when it is non-zero and s otherwise.

Returns:
s/|s| for nonzero s

add

public final Sedenion add(Sedenion t)

Returns the sum of this sedenion s and the sedenion t = b0 + ib1 + jb2 + kb3 + e'b4 + i'b5 + j'b6 + k'b7 + e''b8 + i''b9 + j''b10 + k''b11 + e'''b12 + i'''b13 + j'''b14 + k'''b15.

s + t = (a0 + b0) + i(a1 + b1) + j(a2 + b2) + k(a3 + b3) + e'(a4 + b4) + i'(a5 + b5) + j'(a6 + b6) + k'(a7 + b7) + e''(a8 + b8) + i''(a9 + b9) + j''(a10 + b10) + k''(a11 + b11) + e'''(a12 + b12) + i'''(a13 + b13) + j'''(a14 + b14) + k'''(a15 + b15).

Returns:
s + t

add

public final Sedenion add(int n,
                          double x)

Returns this sedenian s with x added onto its nth term.

Parameters:
n - the number (0, 1, 2, ..., 15) of the onto which to add x
Returns:
s with x added onto the coefficient of the nth term

add

public final Sedenion add(double x)

Returns the sum of this sedenion s and the real number x.

s + x = (a0 + x) + ia1 + ja2 + ka3 + e'a4 + i'a5 + j'a6 + k'a7 + e''a8 + i''a9 + j''a10 + k''a11 + e'''a12 + i'''a13 + j'''a14 + k'''a15.

Returns:
s + x

subtract

public final Sedenion subtract(Sedenion t)

Returns the difference between this sedenion s and the sedenion t = b0 + ib1 + jb2 + kb3 + e'b4 + i'b5 + j'b6 + k'b7 + e''b8 + i''b9 + j''b10 + k''b11 + e'''b12 + i'''b13 + j'''b14 + k'''b15.

s - t = (a0 - b0) + i(a1 - b1) + j(a2 - b2) + k(a3 - b3) + e'(a4 - b4) + i'(a5 - b5) + j'(a6 - b6) + k'(a7 - b7) + e''(a8 - b8) + i''(a9 - b9) + j''(a10 - b10) + k''(a11 - b11) + e'''(a12 - b12) + i'''(a13 - b13) + j'''(a14 - b14) + k'''(a15 - b15).

Returns:
s - t

negate

public final Sedenion negate()

Returns the negative of this sedenion s.

-s = -a0 - ia1 - ja2 - ka3 - e'a4 - i'a5 - j'a6 - k'a7 - e''a8 - i''a9 - j''a10 - k''a11 - e'''a12 - i'''a13 - j'''a14 - k'''a15.

Returns:
-s

multiply

public final Sedenion multiply(Sedenion t)

Returns the product of this sedenion s and the sedenion t = b0 + ib1 + jb2 + kb3 + e'b4 + i'b5 + j'b6 + k'b7 + e''b8 + i''b9 + j''b10 + k''b11 + e'''b12 + i'''b13 + j'''b14 + k'''b15.

Multiplication is distributive with the following multiplication matrix for 1 and the imaginary units:

×1ijke'i'j'k'e''i''j''k''e'''i'''j'''k'''
11ijke'i'j'k'e''i''j''k''e'''i'''j'''k'''
ii-1k-ji'-e'-k'j'i''-e''-k''j''-i'''e'''k'''-j'''
jj-k-1ij'k'-e'-i'j''k''-e''-i''-j'''-k'''e'''i'''
kkj-i-1k'-j'i'-e'k''-j''i''-e''-k'''j'''-i'''e'''
e'e'-i'-j'-k'-1ijke'''i'''j'''k'''-e''-i''-j''-k''
i'i'e'-k'j'-i-1-kji'''-e'''k'''-j'''i''-e''k''-j''
j'j'k'e'-i'-jk-1-ij'''-k'''-e'''i'''j''-k''-e''i''
k'k'-j'i'e'-k-ji-1k'''j'''-i'''-e'''k''j''-i''-e''
e''e''-i''-j''-k''-e'''-i'''-j'''-k'''-1ijke'i'j'k'
i''i''e''-k''j''-i'''e'''k'''-j'''-i-1-kj-i'e'k'-j'
j''j''k''e''-i''-j'''-k'''e'''i'''-jk-1-i-j'-k'e'i'
k''k''-j''i''e''-k'''j'''-i'''e'''-k-ji-1-k'j'-i'e'
e'''e'''i'''j'''k'''e''-i''-j''-k''-e'i'j'k'-1-i-j-k
i'''i'''-e'''k'''-j'''i''e''k''-j''-i'-e'k'-j'i-1k-j
j'''j'''-k'''-e'''i'''j''-k''e''i''-j'-k'-e'i'j-k-1i
k'''k'''j'''-i'''-e'''k''j''-i''e''-k'j'-i'-e'kj-i-1

In general, st ≠ ts, s(tu) ≠ (st)u, and s(st) ≠ s2t.

Returns:
st

multiply

public final Sedenion multiply(double x)

Returns the product of this sedenion s and the real number x.

sx = xa0 + ixa1 + jxa2 + kxa3 + e'xa4 + i'xa5 + j'xa6 + k'xa7 + e''xa8 + i''xa9 + j''xa10 + k''xa11 + e'''xa12 + i'''xa13 + j'''xa14 + k'''xa15

Returns:
sx

divide

public final Sedenion divide(Sedenion t)

Returns the quotient of this sedenion s over the sedenion t = b0 + ib1 + jb2 + kb3 + e'b4 + i'b5 + j'b6 + k'b7 + e''b8 + i''b9 + j''b10 + k''b11 + e'''b12 + i'''b13 + j'''b14 + k'''b15.

s/t = sconjugate(t)/|t|2. In general, s/t ≠ (1/p)q.

Returns:
s/t

pow

public final Sedenion pow(Sedenion t)
Returns this sedenion s raised to the sedenion t.

Returns:
st

pow

public final Sedenion pow(double x)

Returns this sedenion s raised to the real number x.

Returns:
sx

pow

public final Sedenion pow(int n)

Returns this sedenion s raised to the integer n.

Returns:
sn

sqr

public final Sedenion sqr()

Returns the square of this sedenion s.

Returns:
s2

horner

public final Sedenion horner(double[] v)

Evaluate the polynomial with real coefficients, given by the array of doubles v, at this sedenion s.

If n = v.length - 1 then this method evaluates v0 + v1s + ... + vnsn using Horner's rule.

Returns:
v0 + v1s + ... + vnsn.

sqrt

public final Sedenion sqrt()

Returns the square root of this sedenion s.

The branch cut is on (-∞, 0).

Returns:
sqrt(s)

sqrt

public final Sedenion sqrt(Sedenion u)

Returns the square root of this sedenion s.

The branch cut is on (-∞, 0).

On the branch cuts, the imaginary part is a multiple of the imaginary sedenion u.

Parameters:
u - a non-real sedenion
Returns:
sqrt(s)

exp

public final Sedenion exp()

Returns Euler's number (e) raised to the power of this sedenion s.

If u = imag(s)/|imag(s)| then es = ea(cos|imag(s)| + u sin|imag(s)|).

Returns:
es
See Also:
log()

log

public final Sedenion log()

Returns the natural logarithm of this sedenion s.

The branch cut is on (-∞, 0].

Returns:
log(s)
See Also:
exp()

log

public final Sedenion log(Sedenion u)

Returns the natural logarithm of this sedenion s.

The branch cut is on (-∞, 0].

On the branch cuts, the imaginary part is a multiple of the imaginary sedenion u.

Parameters:
u - a non-real sedenion
Returns:
log(s)
See Also:
exp()

log10

public final Sedenion log10()

Returns the logarithm base 10 of this sedenion s.

The branch cut is on (-∞, 0].

Returns:
log10(s)

log10

public final Sedenion log10(Sedenion u)

Returns the natural logarithm of this sedenion s.

The branch cut is on (-∞, 0].

On the branch cuts, the imaginary part is a multiple of the imaginary sedenion u.

Parameters:
u - a non-real sedenion
Returns:
log10(s)

sin

public final Sedenion sin()

Returns the sine of this sedenion s.

Returns:
sin(s)
See Also:
asin()

cos

public final Sedenion cos()

Returns the cosine of this sedenion s.

Returns:
cos(s)
See Also:
acos()

tan

public final Sedenion tan()

Returns the tangent of this sedenion s.

Returns:
tan(s)
See Also:
atan()

sec

public final Sedenion sec()

Returns the secant of this sedenion s.

Returns:
sec(s)
See Also:
asec()

csc

public final Sedenion csc()

Returns the cosecant of this sedenion s.

Returns:
csc(s)
See Also:
acsc()

cot

public final Sedenion cot()

Returns the cotangent of this sedenion s.

Returns:
cot(s)
See Also:
acot()

sinh

public final Sedenion sinh()

Returns the hyperbolic sine of this sedenion s.

Returns:
sinh(s)
See Also:
asinh()

cosh

public final Sedenion cosh()

Returns the hyperbolic cosine of this sedenion s.

Returns:
cosh(s)
See Also:
acosh()

tanh

public final Sedenion tanh()

Returns the hyperbolic tangent of this sedenion s.

Returns:
tanh(s)
See Also:
atanh()

sech

public final Sedenion sech()

Returns the hyperbolic secant of this sedenion s.

Returns:
sech(s)
See Also:
asech()

csch

public final Sedenion csch()

Returns the hyperbolic cosecant of this sedenion s.

Returns:
csch(s)
See Also:
acsch()

coth

public final Sedenion coth()

Returns the hyperbolic cotangent of this sedenion s.

Returns:
coth(s)
See Also:
acoth()

asin

public final Sedenion asin()

Returns the principal inverse sine of this sedenion s.

The branch cuts are (-∞, -1) and (1, ∞).

Returns:
asin(s)
See Also:
sin()

asin

public final Sedenion asin(Sedenion u)

Returns the principal inverse sine of this sedenion s.

The branch cuts are (-∞, -1) and (1, ∞).

On the branch cuts, the imaginary part is a multiple of the imaginary sedenion u.

Parameters:
u - a non-real sedenion
Returns:
asin(s)
See Also:
sin()

acos

public final Sedenion acos()

Returns the principal inverse cosine of this sedenion s.

The branch cuts are (-∞, -1) and (1, ∞).

Returns:
acos(s)
See Also:
cos()

acos

public final Sedenion acos(Sedenion u)

Returns the principal inverse cosine of this sedenion s.

The branch cuts are (-∞, -1) and (1, ∞).

On the branch cuts, the imaginary part is a multiple of the imaginary sedenion u.

Parameters:
u - a non-real sedenion
Returns:
acos(s)
See Also:
cos()

atan

public final Sedenion atan()

Returns the principal inverse tangent of this sedenion s.

The branch cuts are (-u∞, -u] and [u, u∞).

Returns:
atan(s)
See Also:
tan()

atan

public final Sedenion atan(Sedenion u)

Returns the principal inverse tangent of this sedenion s.

The branch cuts are (-u∞, -u] and [u, u∞).

On the branch cuts, the imaginary part is a multiple of the imaginary sedenion u.

Parameters:
u - a non-real sedenion
Returns:
atan(s)
See Also:
tan()

asec

public final Sedenion asec()

Returns the principal inverse secant of this sedenion s.

The branch cut is (-1, 1).

Returns:
asec(s)
See Also:
sec()

asec

public final Sedenion asec(Sedenion u)

Returns the principal inverse secant of this sedenion s.

The branch cut is (-1, 1).

On the branch cuts, the imaginary part is a multiple of the imaginary sedenion u.

Parameters:
u - a non-real sedenion
Returns:
asec(s)
See Also:
sec()

acsc

public final Sedenion acsc()

Returns the principal inverse cosecant of this sedenion s.

The branch cut is (-1, 1).

Returns:
acsc(s)
See Also:
csc()

acsc

public final Sedenion acsc(Sedenion u)

Returns the principal inverse cosecant of this sedenion s.

The branch cut is (-1, 1).

On the branch cuts, the imaginary part is a multiple of the imaginary sedenion u.

Parameters:
u - a non-real sedenion
Returns:
acsc(s)
See Also:
csc()

acot

public final Sedenion acot()

Returns the principal inverse cotangent of this sedenion s.

The branch cut is (-u, u).

Returns:
acot(s)
See Also:
cot()

acot

public final Sedenion acot(Sedenion u)

Returns the principal inverse cotangent of this sedenion s.

The branch cut is (-u, u).

On the branch cuts, the imaginary part is a multiple of the imaginary sedenion u.

Parameters:
u - a non-real sedenion
Returns:
acot(s)
See Also:
cot()

asinh

public final Sedenion asinh()

Returns the principal inverse hyperbolic sine of this sedenion s.

The branch cuts are (-u∞, -u) and (u, u∞).

Returns:
asinh(s)
See Also:
sinh()

asinh

public final Sedenion asinh(Sedenion u)

Returns the principal inverse hyperbolic sine of this sedenion s.

The branch cuts are (-u∞, -u) and (u, u∞).

On the branch cuts, the imaginary part is a multiple of the imaginary sedenion u.

Parameters:
u - a non-real sedenion
Returns:
asinh(s)
See Also:
sinh()

acosh

public final Sedenion acosh()

Returns the principal inverse hyperbolic cosine of this sedenion s.

The branch cut is (-∞, 1).

Returns:
acosh(s)
See Also:
cosh()

acosh

public final Sedenion acosh(Sedenion u)

Returns the principal inverse hyperbolic cosine of this sedenion s.

The branch cut is (-∞, 1).

On the branch cuts, the imaginary part is a multiple of the imaginary sedenion u.

Parameters:
u - a non-real sedenion
Returns:
acosh(s)
See Also:
cosh()

atanh

public final Sedenion atanh()

Returns the principal inverse hyperbolic tangent of this sedenion s.

The branch cuts are (-∞, -1] and [1, ∞).

Returns:
atanh(s)
See Also:
tanh()

atanh

public final Sedenion atanh(Sedenion u)

Returns the principal inverse hyperbolic tangent of this sedenion s.

The branch cuts are (-∞, -1] and [1, ∞).

On the branch cuts, the imaginary part is a multiple of the imaginary sedenion u.

Parameters:
u - a non-real sedenion
Returns:
atanh(s)
See Also:
tanh()

asech

public final Sedenion asech()

Returns the principal inverse hyperbolic secant of this sedenion s.

The branch cuts are (-∞, 0] and (1, ∞).

Returns:
asech(s)
See Also:
sech()

asech

public final Sedenion asech(Sedenion u)

Returns the principal inverse hyperbolic secant of this sedenion s.

The branch cuts are (-∞, 0] and (1, ∞).

On the branch cuts, the imaginary part is a multiple of the imaginary sedenion u.

Parameters:
u - a non-real sedenion
Returns:
asech(s)
See Also:
sech()

acsch

public final Sedenion acsch()

Returns the principal inverse hyperbolic cosecant of this sedenion s.

The branch cut is (-i, i).

Returns:
acsch(s)
See Also:
csch()

acsch

public final Sedenion acsch(Sedenion u)

Returns the principal inverse hyperbolic cosecant of this sedenion s.

The branch cut is (-u, u).

On the branch cuts, the imaginary part is a multiple of the imaginary sedenion u.

Parameters:
u - a non-real sedenion
Returns:
acsch(s)
See Also:
csch()

acoth

public final Sedenion acoth()

Returns the principal inverse hyperbolic cotangent of this sedenion s.

The branch cut is [-1, 1].

Returns:
acoth(s)
See Also:
coth()

acoth

public final Sedenion acoth(Sedenion u)

Returns the principal inverse hyperbolic cotangent of this sedenion s.

The branch cut is [-1, 1].

On the branch cuts, the imaginary part is a multiple of the imaginary sedenion u.

Parameters:
u - a non-real sedenion
Returns:
acoth(s)
See Also:
coth()

ceil

public final Sedenion ceil()

Returns the ceiling of each of the coefficients of this sedenion s.

Returns:
ceil(a0) + i ceil(a1)+ j ceil(a2)+ k ceil(a3)+ e' ceil(a4)+ i' ceil(a5)+ j' ceil(a6)+ k' ceil(a7)+ e'' ceil(a8)+ i'' ceil(a9)+ j'' ceil(a10)+ k'' ceil(a11)+ e''' ceil(a12)+ i''' ceil(a13)+ j''' ceil(a14)+ k''' ceil(a15)
See Also:
Math.ceil(double)

floor

public final Sedenion floor()

Returns the floor of each of the coefficients of this sedenion s.

Returns:
floor(a0) + i floor(a1)+ j floor(a2)+ k floor(a3)+ e' floor(a4)+ i' floor(a5)+ j' floor(a6)+ k' floor(a7)+ e'' floor(a8)+ i'' floor(a9)+ j'' floor(a10)+ k'' floor(a11)+ e''' floor(a12)+ i''' floor(a13)+ j''' floor(a14)+ k''' floor(a15)
See Also:
Math.floor(double)

rint

public final Sedenion rint()

Returns each coefficient of the sedenion s rounded to the nearest double equal to an integer.

Returns:
rint(a0) + i rint(a1)+ j rint(a2)+ k rint(a3)+ e' rint(a4)+ i' rint(a5)+ j' rint(a6)+ k' rint(a7)+ e'' rint(a8)+ i'' rint(a9)+ j'' rint(a10)+ k'' rint(a11)+ e''' rint(a12)+ i''' rint(a13)+ j''' rint(a14)+ k''' rint(a15)
See Also:
Math.rint(double)