Quaternion Function Reference

complex

Construct a complex quaternion from real quaternions.
(Quaternion and octonion overloadings of standard MATLAB® function)

Syntax

q = complex(a,b)

Description

complex takes two quaternion arguments and constructs a complexified quaternion with the first quaternion as real part, and the second as the imaginary part. The result is equivalent to a + i * b (where i is the standard MATLAB® complex operator).

Once constructed, a complexified quaternion can be separated into four complex components, or two quaternions (real and imaginary). It is of course also possible to construct complexified quaternions by other means, from four complex components.

The two arguments must be of the same size, unless one is scalar. If this is the case the scalar argument is promoted in size to match the non-scalar argument. (This behaviour matches the way the corresponding MATLAB® function operates.)

Examples

>> q = complex(quaternion(1,2,3,4), quaternion(5,6,7,8))
 
q = (1+5i) + (2+6i) * I + (3+7i) * J + (4+8i) * K

See Also

MATLAB® function: complex
QTFM functions: real, imag

References

  1. Ward, J. P., "Quaternions and Cayley numbers", Kluwer, 1997.

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

License terms.