Class Octonion
- All Implemented Interfaces:
AbelianGroup<Octonion>, AbelianMonoid<Octonion>, Group<Octonion>, Magma<Octonion>, Monoid<Octonion>, Field<Octonion>, Ring<Octonion>, Semiring<Octonion>, Set<Octonion>
Octonions extend quaternions but are non-associative. They form the largest normed division algebra over the real numbers.
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionOctonion(double e0, double e1, double e2, double e3, double e4, double e5, double e6, double e7) Creates an octonion from 8 real components. o = e0 + e1*i + e2*j + e3*k + e4*l + e5*il + e6*jl + e7*kl -
Method Summary
Modifier and TypeMethodDescriptionReturns the sum of two elements (additive notation).intReturns the characteristic of this field.Returns the conjugate of this octonion.booleanTests whether this set contains the specified element.Returns a human-readable description of this set.divides(double s) Divides this octonion by a scalar.Divides this octonion by another.booleanstatic OctonionCreates an octonion from a complex number (last 6 components = 0).static OctonionCreates an octonion from a quaternion (last 4 components = 0).getE0()getE1()getE2()getE3()getE4()getE5()getE6()getE7()inthashCode()inverse()Returns the multiplicative inverse of this octonion.Returns the multiplicative inverse of a non-zero element.booleanisEmpty()Returnstrueif this set contains no elements.booleanFields always have commutative multiplication.Subtracts another octonion from this one.Returns the product of two elements.negate()Returns the negation of this octonion.Returns the additive inverse (negation) of an element.norm()Returns the norm (magnitude) of this octonion.Returns the squared norm.one()Returns the multiplicative identity (one element).Performs the binary operation on two elements.Adds another octonion to this one.real()Returns the real part (e0).Returns the difference of two elements.times(double s) Multiplies this octonion by a scalar.Multiplies this octonion by another using the Cayley-Dickson construction.toString()zero()Returns the additive identity (zero element).Methods inherited from interface AbelianGroup
isCommutativeMethods inherited from interface AbelianMonoid
identity, isCommutativeMethods inherited from interface Monoid
isAssociative
-
Field Details
-
ZERO
The zero octonion. -
ONE
The unit (1,0,0,0,0,0,0,0).
-
-
Constructor Details
-
Octonion
-
Octonion
public Octonion(double e0, double e1, double e2, double e3, double e4, double e5, double e6, double e7)
-
-
Method Details
-
fromQuaternion
Creates an octonion from a quaternion (last 4 components = 0). -
fromComplex
-
getE0
-
getE1
-
getE2
-
getE3
-
getE4
-
getE5
-
getE6
-
getE7
-
real
Returns the real part (e0). -
norm
Returns the norm (magnitude) of this octonion. -
normSquared
Returns the squared norm. -
conjugate
Returns the conjugate of this octonion. -
negate
Returns the negation of this octonion. -
plus
-
minus
-
times
Multiplies this octonion by a scalar. -
divides
Divides this octonion by a scalar. -
divides
-
times
-
inverse
Returns the multiplicative inverse of this octonion. -
divides
-
equals
-
hashCode
-
toString
-
operate
Description copied from interface:MagmaPerforms the binary operation on two elements.This is the fundamental operation of a magma. The result must be an element of this magma (closure property).
Properties: None required (not necessarily associative or commutative)
-
add
Description copied from interface:AbelianMonoidReturns the sum of two elements (additive notation).Delegates to
Magma.operate(Object, Object).- Specified by:
addin interfaceAbelianMonoid<Octonion>- Parameters:
left- the first addendright- the second addend- Returns:
- a + b
-
subtract
Description copied from interface:AbelianGroupReturns the difference of two elements.Defined as: a - b = a + (-b)
- Specified by:
subtractin interfaceAbelianGroup<Octonion>- Parameters:
left- the minuendright- the subtrahend- Returns:
- a - b
- See Also:
-
multiply
Description copied from interface:SemiringReturns the product of two elements.Multiplication must be associative and distribute over addition.
-
zero
Description copied from interface:AbelianMonoidReturns the additive identity (zero element).Delegates to
AbelianMonoid.identity().- Specified by:
zeroin interfaceAbelianMonoid<Octonion>- Returns:
- the zero element
-
one
-
negate
Description copied from interface:AbelianGroupReturns the additive inverse (negation) of an element.Satisfies: a + (-a) = (-a) + a = 0
- Specified by:
negatein interfaceAbelianGroup<Octonion>- Parameters:
element- the element to negate- Returns:
- -element
- See Also:
-
inverse
Description copied from interface:FieldReturns the multiplicative inverse of a non-zero element.For element a ≠0, returns a⻹ such that: a × a⻹ = a⻹ × a = 1
Examples:
- In ℚ: inverse(2/3) = 3/2
- In â„Â: inverse(5.0) = 0.2
- In â„‚: inverse(3+4i) = (3-4i)/25
-
isMultiplicationCommutative
public boolean isMultiplicationCommutative()Description copied from interface:FieldFields always have commutative multiplication.- Specified by:
isMultiplicationCommutativein interfaceField<Octonion>- Specified by:
isMultiplicationCommutativein interfaceSemiring<Octonion>- Returns:
- always
true
-
characteristic
public int characteristic()Description copied from interface:FieldReturns the characteristic of this field.The characteristic is the smallest positive integer n such that:
1 + 1 + ... + 1 (n times) = 0
If no such n exists, the characteristic is 0.Examples:
- char(ℚ) = char(â„Â) = char(â„‚) = 0
- char(ðÂâ€Â½Ã¢â€šÅ¡) = p (for prime p)
- Specified by:
characteristicin interfaceField<Octonion>- Returns:
- the characteristic (0 for infinite fields, p for finite fields)
-
description
Description copied from interface:SetReturns a human-readable description of this set.Examples:
- "â„ (Real Numbers)"
- "ℤ/12ℤ (Integers modulo 12)"
- "{1, 2, 3, 4, 5}"
- Specified by:
descriptionin interfaceSet<Octonion>- Returns:
- a description of this set
-
isEmpty
public boolean isEmpty()Description copied from interface:SetReturnstrueif this set contains no elements.The empty set (∅) is a fundamental concept in set theory. It is the unique set containing no elements.
-
contains
Description copied from interface:SetTests whether this set contains the specified element.This is the fundamental operation of a set - membership testing.
-