Quaternion Function Reference

quaternion

Octonion constructor

Syntax

o = octonion(w, x, y, z, a, b, c, d)

Description

This function constructs octonion (arrays) from components. It accepts zero, one, two, seven or eight arguments. The permissible cases are set out in the following paragraphs.

Given no arguments, this function constructs an empty octonion.

Given one argument which is already an octonion, the function returns the argument unchanged. If the argument is not an octonion, the function constructs one with the argument in the scalar part and supplies a zero vector part of the same type as the argument. Thus if the argument is a double, the result will have a vector part with double zeros as components.

If two arguments are supplied, the first must be numeric, and the second must be a pure octonion of the same size. The result will be a full octonion. The first argument must have the same class as the components of the second. This is to prevent the creation of octonion arrays of mixed class.

If seven arguments are supplied, they must be numeric and of the same size and class. The result is a pure octonion.

If eight arguments are supplied, they must be numeric and of the same size and class. The result is a full octonion.

Examples

>> octonion(1, 2, 3, 4, 5, 6, 7, 8)
 
ans = 1 + 2 * I + 3 * J + 4 * K + 5 * L + 6 * M + 7 * N + 8 * O

© 2008-2013 Stephen J. Sangwine and Nicolas Le Bihan

License terms.